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
 Origin Forum
 data substraction

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
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

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