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
 Subtract Reference Data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Koguma

Brazil
Posts

Posted - 07/12/2006 :  2:56:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version : Origin 7.0
Operating System: Windows XP Professional Service Pack 2

Hi! I am a Brazilian student and a iniciant im Origin .
I need to subtract 2 worksheets, as the same way that "Subtract Reference Data" do.
for example:

Worksheet 1

-10,328 -4,06987
-8,4 -4,07602
-6,471 -3,9386
-4,543 -2,36346
-2,614 3,68485
-0,686 14,46679
1,243 22,8573
3,171 21,63493
5,1 13,3203
7,028 5,31742
8,957 0,52841
10,885 -2,03736
12,813 -3,35818
14,742 -3,93245
16,67 -4,08012
18,599 -4,06576
20,527 -4,05756
22,456 -4,08012
24,384 -4,10473
26,313 -4,10678

worksheet 2

808,391 0,24363
1807,52595 -0,00219

There is some method in the Origin C to do this?
I try to do this:

Dataset d1(wks1.Columns(0));
Dataset d2(wks3.Columns(0));
d2=d1;
Dataset d3(wks2.Columns(1));
Dataset d4(wks1.Columns(1));
Dataset d5(wks3.Columns(1));
d5=d4-d3;

Subtract wk1 to wks2 and place the result in wks3, but doesnt work!
The number of rows may be the problem?
Please help me i dont think in any solution! Please forgive my English too! Thanks!

Mike Buess

USA
3037 Posts

Posted - 07/12/2006 :  7:57:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Probably easiest with the LabTalk vector subtraction method used by Subtract Reference Data because it interpolates automatically. See Help > Programming > LabTalk Language Reference > Overview... > Performing Calculations > Vector Calculations > Calculations Using Interpolation.

Dataset d1(wks1.Columns(0));
Dataset d2(wks3.Columns(0));
d2 = d1;
Dataset d3(wks2.Columns(1));
Dataset d4(wks1.Columns(1));
Dataset d5(wks3.Columns(1));
d5 = d4;
LT_execute(d5.GetName() + " --O " + d3.GetName());

Mike Buess
Origin WebRing Member
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