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
 Origin Forum
 Set Column Values if-function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Chrissab

Germany
5 Posts

Posted - 09/16/2013 :  09:27:56 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I want to do a simple test with an if-function (to binarize a signal).
Col(A): (signal Y, sampling intervall dx=0,001)
Col(B): (values Y, sampling intervall dx=1)

If the value in Col(A) is smaller than the value of the matching sampling intervall in Col(B)--> 1, else --> 0.

How can I realize that in a very simple way, maybe with "set column values" I've never worked with LabTalk yet. (I have OriginPro)

Thanks for each help!

snowli

USA
1386 Posts

Posted - 09/16/2013 :  12:18:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Origin supports conditional operator. The syntax is
Expression1 ? Expression2 : expression3
If expression 1 is true, then run expression2. If false, then use expression 3.

E.g. if you have col(A) and col(B) with values, add a new column C.
Set column C's values to be
Col(A)<col(B)? 1 : 0


I am not sure what you mean by "If the value in Col(A) is smaller than the value of the matching sampling intervall in Col(B)", but u can see the example above to get an idea.

Thanks, Snow Li
OriginLab Corp.
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