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
 Determine cycle number

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
Pardub Posted - 10/15/2018 : 07:33:22 AM
I have a set of data. I'm trying to make a script which evaluates certain two conditions.If conditions is fulfilled 1st time the script will insert 1 into next column and to all rows between 1st and 2nd fulfillment of this condition. Then the same way it puts 2, 3 , 4..until the end. Could somebody advice how to do it?
2   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 10/16/2018 : 4:58:55 PM
Hi,

Though as Chris wrote what you wanted was not so clear, maybe you can have 2 extra columns - in the first column,
if your condition met the data, set 1, otherwise 0. Then, you can make accumulation through to set the rows in the
second column. See the sample below.
Here, if(r2[ii]*r2[ii-1]<0) r3[ii]=1; else r3[ii]=0; is a sample condition to judge if the curve crosses Y=0 to set in col(3).
Of course, you can replace the condition to yours.
The accumulation for col(4) can be done by simply a sum function, sum(col(3)).



Does it help?

--Hideo Fujii
OriginLab
Chris D Posted - 10/15/2018 : 3:21:00 PM
Hi,

Can you provide a bit more information such as an example dataset and perhaps some of the conditions? If you like, you can email them to tech@originlab.com for us to evaluate via email.


Thanks,
Chris Drozdowski
Originlab Technical Support

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