The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 How to remove a blank column from many other?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
France3 Posted - 06/09/2010 : 2:06:15 PM
Origin Ver. 8.0724 and Service Release 2007 (Select Help-->About Origin):
Operating System: windows vista (64bits)


I have just few basis in programming and I really don't understand how do to resolve the following problem (I guess it's quite simple for you ).

Ok.
My worksheet is composed of a variable number of columns. The first column is X (wavelength), the second one is Y(absorption of the solvent=blank) and the followings are many spectra (Y) with the absorption of the solvent (constant) + a absorption of an another compound (variable).

So, how can I remove the value of the blank column from all the other at each wavelength.
It means Y(2)=Y(2)-Y(1), Y(3)=Y(3)-Y(1),... Y(n)=Y(n)-Y(1)

thanks
2   L A T E S T    R E P L I E S    (Newest First)
France3 Posted - 06/10/2010 : 03:54:03 AM
Great !!!

Thank you, I'll try it asap.
Penn Posted - 06/09/2010 : 10:17:49 PM
Hi,

This wiki page has provided some examples on how to access data from worksheet. For your issue, you can try the following code.

void accessData()
{
	Worksheet wks = Project.ActiveLayer();
	if(!wks)
		return;
	
	Column colY1 = wks.Columns(1);  // Y1 column
	if(!colY1)
		return;
	
	vector& vecColY1 = colY1.GetDataObject();  // get data of Y1 column
	
	for(int iCol=2; iCol<wks.Columns.Count(); iCol++)
	{
		Column colYiCol = wks.Columns(iCol);
		if(!colYiCol)
			continue;
		
		vector& vecColYiCol = colYiCol.GetDataObject();
		vecColYiCol = vecColYiCol-vecColY1;  // Y(n)=Y(n)-Y(1)
	}
}


Penn

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000