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
|
|
|