T O P I C R E V I E W |
xpsun |
Posted - 04/11/2006 : 5:48:04 PM 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 |
2 L A T E S T R E P L I E S (Newest First) |
xpsun |
Posted - 04/13/2006 : 5:04:16 PM thanks Zach, it works. |
zachary_origin |
Posted - 04/11/2006 : 11:42:26 PM 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 |
|
|