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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Data processing questions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jlw2000

USA
Posts

Posted - 04/05/2008 :  4:30:27 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Deanna

China
Posts

Posted - 04/06/2008 :  11:04:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000