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
 LabTalk Forum
 Interpolating Data in Labtalk

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
HansBrouwer Posted - 08/01/2005 : 10:03:33 AM
Hi everybody,

My name is Hans Brouwer. I have been working with origin for a very short time, so i am really fresh. It could be that i am boring some of you with my questions, but i would like to have some advice about Interpolating Data in Labtalk.

I have a worksheet containing say 1000 columns Y and 1 column X. I would like to interpolate all these columns. Manually it is done by selecting X and one of the Y, Plot it and then interpolate the graph using the Analysis-Interpolate/Extrapolate option.

I have tried to obtain information from the Programming Help file. Could be that i am not looking hard enough, or that it is not there.
Could anyone help me out here?

Best Regards,

Hans Brouwer
6   L A T E S T    R E P L I E S    (Newest First)
HansBrouwer Posted - 10/26/2005 : 03:33:47 AM
Hey Mike,

Thanks Alot!! My spectra look great.
Best wishes,

Hans
Mike Buess Posted - 10/25/2005 : 11:22:42 AM
Hi Hans,

Try replacing %(%W,2) with %(%W,i) in the Table command.

Mike Buess
Origin WebRing Member
HansBrouwer Posted - 10/25/2005 : 11:03:14 AM
Hi Mike,

It has been a while since i posted this question. Now i finally had to use your program. After running this program, the Data2 worksheet contains the same number of Y columns as Data1, but all columns are filled with the same numbers.

Could you help me out?

Best Regards,

Hans Brouwer
HansBrouwer Posted - 10/25/2005 : 10:59:58 AM
quote:

Hi Hans,

This is probably better done in Origin C but you can also use LabTalk's Table function. Assume your data are in Data1 with first col A(X). Create a new worksheet Data2 and fill its col A(X) with the X values at which you want to interpolate. Next, delete all Y columns in Data2. Finally, run this script...

%W=Data1;
win -a Data2; // activate results wks
loop (i,2,%W!wks.ncols) {
wo -a 1; // add Y column to Data2
%(%H,i)=Table(%(%W,1), %(%W,2), %(%H,1));
};

I'm not sure what type of interpolation (probably linear) is used by the Table function but it has produced reasonable results when I've used it.

...A more detailed description of the Table function is available in the Knowledge Base.

http://www.originlab.com/www/support/resultstech.aspx?ID=680&language=English

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/01/2005 11:15:16 AM

Edited by - Mike Buess on 08/01/2005 11:27:28 AM

HansBrouwer Posted - 08/01/2005 : 4:39:37 PM
Hey Mike,

Thank you for helping me out!! I am not at work now, but i will use your script tomorrow morning.

Best regards,

Hans
Mike Buess Posted - 08/01/2005 : 11:10:20 AM
Hi Hans,

This is probably better done in Origin C but you can also use LabTalk's Table function. Assume your data are in Data1 with first col A(X). Create a new worksheet Data2 and fill its col A(X) with the X values at which you want to interpolate. Next, delete all Y columns in Data2. Finally, run this script...

%W=Data1;
win -a Data2; // activate results wks
loop (i,2,%W!wks.ncols) {
wo -a 1; // add Y column to Data2
%(%H,i)=Table(%(%W,1), %(%W,2), %(%H,1));
};

I'm not sure what type of interpolation (probably linear) is used by the Table function but it has produced reasonable results when I've used it.

...A more detailed description of the Table function is available in the Knowledge Base.

http://www.originlab.com/www/support/resultstech.aspx?ID=680&language=English

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/01/2005 11:15:16 AM

Edited by - Mike Buess on 08/01/2005 11:27:28 AM

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