Author |
Topic  |
|
xpsun
USA
4 Posts |
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 |
|
zachary_origin
China
Posts |
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 |
 |
|
xpsun
USA
4 Posts |
Posted - 04/13/2006 : 5:04:16 PM
|
thanks Zach, it works. |
 |
|
|
Topic  |
|
|
|