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 for Programming
 LabTalk Forum
 apply an origin c function on a dataset

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
peroma Posted - 01/31/2003 : 08:06:30 AM
I have made an origin c function for the calculation of a dataset. But I don't know, how to call the function so that the values of a complete dataset will be calculated. I cannot believe that the only way is, to write a loop so that each value is calculated separately.

Can anyone help me with the correct syntax?

Thanks,
Peter
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 01/31/2003 : 12:20:17 PM
Hi Peter,

You can pass a whole dataset to the function and OC will know to deal with it correctly.

For example, if you have the following function in OC:

double myfunc(double x)
{
return x*2;
}


you can then go to script window and type
myfunc(3)=
and you will get 6.
Also, you can type in script window:
data1_b = myfunc(data1_a)
and column b will have values double of column a.

Note that you can also do the above within OC itself.
For example, you can call your previous function in another OC function, such as:


void dd()
{
Dataset ds1("Data1_A");
Dataset ds2("Data1_B");

ds2=myfunc(ds1);
}


Easwar
OriginLab.


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