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
 LabTalk Forum
 Determine cycle number
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Pardub

1 Posts

Posted - 10/15/2018 :  07:33:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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?

Chris D

428 Posts

Posted - 10/15/2018 :  3:21:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 10/16/2018 :  4:58:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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