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
 Origin Forum
 data substraction
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

xpsun

USA
4 Posts

Posted - 04/11/2006 :  5:48:04 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin):
Operating System:windows XP pro, origin 7.0
I have two unequal length data columns, column A (200 rows) and B (30 rows. How can I get differences between column A (all rows)and column B for each row[1-30] consecutively and put the differences in 30 columns of the other worksheet?
thank you

zachary_origin

China
Posts

Posted - 04/11/2006 :  11:42:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I wrote an function in Origin C. You can copy, build and run it in CodeBuilder (Alt+4).

Hope it helps,

Zach
OriginLab GZ office.



void subtract()
{
Worksheet wks = Project.ActiveLayer();

Worksheet wks2;
wks2.Create();
while( wks2.Columns(0) ) wks2.DeleteCol(0);

Dataset ds1(wks, 0);
Dataset ds2(wks, 1);
Dataset dsT;

vector vec;
vec.SetSize( ds1.GetSize() );
for( int ii = 0; ii < ds2.GetSize(); ii ++)
{
int nCol = wks2.AddCol();
dsT.Attach(wks2, nCol);
vec = ds1 - ds2[ii];
dsT = vec;
dsT.Detach();
}

}


quote:

Origin Version (Select Help-->About Origin):
Operating System:windows XP pro, origin 7.0
I have two unequal length data columns, column A (200 rows) and B (30 rows. How can I get differences between column A (all rows)and column B for each row[1-30] consecutively and put the differences in 30 columns of the other worksheet?
thank you



Edited by - zachary_origin on 04/12/2006 02:21:33 AM

Edited by - zachary_origin on 04/12/2006 02:22:52 AM

Edited by - zachary_origin on 04/12/2006 02:23:54 AM
Go to Top of Page

xpsun

USA
4 Posts

Posted - 04/13/2006 :  5:04:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks Zach, it works.
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