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
 Origin Forum
 split one data column into multiple

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
Butterfly98 Posted - 11/21/2013 : 05:02:56 AM
Hi there,

I have a series of measurements in one data column, and to plot this I need the data of each measurement in one separate column.
I have already managed to separate the column using

copy -b 1 col(1) Col(2) -b 1 -e 125
copy -b 126 col(1) Col(3) -b 1 -e 125
copy -b 251 col(1) Col(4) -b 1 -e 125

, meaning that Origin is supposed to copy the first 125 data points from column 1 to column2, the second 125 data points from column 1 to column3, and so on.

However, I have 12250 rows, or 98 columns with 125 data points each, so writing a script like that will take considerable time.

So my question is: How can I write a kind of loop for that function which would also make it easy to change the number of points?

A very similar problem was discussed here in 2010 already (http://originlab.com/forum/topic.asp?TOPIC_ID=8731) but the suggestions there do not work.

I use OriginPro 8.5.0.

Thanks in advance for any help!
2   L A T E S T    R E P L I E S    (Newest First)
Butterfly98 Posted - 11/21/2013 : 09:40:49 AM
Thank you, Castiel, for your answer!

I just changed one thing in the last but one row:

col(1)=rr,

and the loop worked excatly like I hoped!!!
Thank you so much!!!
Castiel Posted - 11/21/2013 : 09:18:56 AM
You may write a LabTalk function.For example,
function int foo(int n,int t)
{
    for(int i=1;i<=t;i++)
    {
        range rr=col(1)[n*(i-1)+1:n*i];
        range dst=wcol(i+1)[1:n];
        dst=rr;
    }
    return 0;
}
newbook;
col(1)={1:12250};
foo(125,98);


©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

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