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
 Data processing questions

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
jlw2000 Posted - 04/05/2008 : 4:30:27 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: Win XP

Hi,

I have two questions related to data processing.
1. I have hundreds of data sets that are imported as XYXY. Is there a way to automatically erase column 3,5,7,...(2n+1) ?

2. Assuming that I have a 10x10 XYY data. Is there a way to generate a data where Y1(1 to 10) is deducted by Y1(9), so that Y1(1)=Y1(1)-Y1(9) and Y1(9)=0, and this also applies for Y2,Y3, ... Y9 as well ?
(Y2(1)=Y2(1)-Y2(9) and Y2(9)=0) . It's for applying offset to dataset from value of a certain cell in that column for each row.

Please help, I can't do this manually. or should I go with MATLAB ?

JL
1   L A T E S T    R E P L I E S    (Newest First)
Deanna Posted - 04/06/2008 : 11:04:26 PM
Hi JL,

If your data is large, it may be not very convenient to perform these manually. I suggest using LabTalk to complete it.

For Question 1, You can use the following script:

maxcol = wks.nCols; //Get the number of columns in the worksheet
nn = maxcol - 1; //The rightmost column to delete

for (ii=nn; ii>=3; ii-=2)
{
%a = %(%h, $(ii)); //Get the dataset of the column to delte
delete %a;
}


Make the worksheet that has the data active. Then copy the script into the Script Window (can be opened by selecting Window: Script Window). Highlight the script and type enter.

For question 2, the following script should work:

for (ii=2; ii<=10; ii++)
{
%a = %(%h, $(ii)); //Get the dataset of a column
%b = %(%h, $(ii), 9); //Get the value in the 9th row (offset)
%a -= %b; //Deduct every value in the column by the offset
}



Deanna
OriginLab Technical Services

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