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
 Forum for Origin C
 Separate data as cycles

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
Fulerena Posted - 07/03/2014 : 2:38:34 PM
Origin Ver. and Service Release (Select Help-->About Origin): 9.1 and 8.5
Operating System:Windows 7

Hi!!!
I have a problem. Sorry for the text but it's complicated to explain. I just survive programming in origin.
In my laboratory the program that gives us the data does not separate each cycle. A cycle is group of values between "x" up to "y" and return to "x". So many times. Some cycles.
Until now, x and y were constant in the cycles so I made a program which used the time as variable and it separated the cycles by ranges of increment of t. I calculated the time in the first cycle (0-t) between x-y-x and this was the first cycle, and for t-2t the second, etc.
wxt test:="col(A)[i]>=0 AND col(A)[i]<=24,75" iw:= [Book1]Sheet1 ow:=[C01]Sheet1;
My problem is, that now, the value of y change with cycles once has a value and in other cycle has a bigger one. So to reach greater potential increases the time between cycles and my program failed.
Someone would know me if you can program, for example, from the first value (line 1 in origin)to find the first maximum (line y) and copy a cycle in a column. And then the next value (line y+1) to the next maximum and then cutting and pasting cycle two in another column.
I know this is somewhat complicated to explain but if someone could help I'd appreciate it.
Thank you
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 07/03/2014 : 4:41:42 PM
If I understand you, your x values increase to some value, then reset to a lower value and start increasing again and that represents a cycle?
If you want to break out each cycle XY pair, you can use this script:

// BEGIN SCRIPT
range rax = 1;
wo -a 2;
target = wks.ncols - 1;
wks.col$(target).type = 4;
mark1 = 1;
lastval = rax[1];
loop(ii,2,rax.GetSize())
{
val = rax[ii];
if( val < lastval )
{
mark2 = ii - 1;
wrcopy ow:=<input> c1:=1 c2:=2 r1:=mark1 r2:=mark2 dc1:=target dr1:=1 label:=LUC format:=1;
wo -a 2;
target = wks.ncols - 1;
wks.col$(target).type = 4;
mark1 = ii;
lastval = val;
}
else lastval = val;
}
// END SCRIPT

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