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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 How to remove a blank column from many other?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

France3

France
2 Posts

Posted - 06/09/2010 :  2:06:15 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Penn

China
644 Posts

Posted - 06/09/2010 :  10:17:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

France3

France
2 Posts

Posted - 06/10/2010 :  03:54:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Great !!!

Thank you, I'll try it asap.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000