Origin Ver. and Service Release (Select Help-->About Origin): Operating System:
Hi there. I'm new to Origin and would like some help/guidance on how to do the following:
I have a column of numbers that serve as an indicator. Most of the numbers are 1s, with occasional 10s. I want to make a new column that has mostly 1s, but when it sees a 10 in the indicator column, I want the next 2500 numbers to be 2. Say the column of indicator is col(K), and the new column I will make is col(F). I have written the following script, but it didn't work. Any help will be appreciated. Thanks a lot! --------------------------------------------------------- int flag= 0; int counter = 0;
for (ii=0; ii< 20000; ii++) { if ( col(K)[ii] == 10 ) { flag = 1; counter = 0; } if (flag == 1) { if (counter < 2500) { col(L)[ii] = 2; } else { flag = 0; } } counter++; }
|