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
 can't fit multiple datasets with nlfit X-function

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
buckmurdock Posted - 05/20/2009 : 11:35:11 AM
Origin 8 SR5, with Vista.

I'm having a lot of trouble using the "range" command with the nlbegin/nlfit/nlend X-functions.

I have a worksheet with many data columns in XYXY... format. I want to fit several of them simultaneously, with individual parameters, and specifying a row range. And I want to fit them directly from the worksheet, without having to plot them first.

It seems like it should work like this:

range aa=1[1001]:8[1200];
nlbegin aa expdecay2 tt cons;
nlfit;
nlend 1;


I expect this to fit my first 4 sets of XY data, but it seems that it only looks at the first column in my range. So this fits col 1 (X data) against itself. If I instead use "range aa = 2[1001:1200]", then it correctly fits col2 against its X data in col1. But if I use "range aa = 1[1001]:2[2000]" then it just fits col1 against itself.

So how can I fit multiple datasets using the X-function commands?

Thanks in advance.
2   L A T E S T    R E P L I E S    (Newest First)
buckmurdock Posted - 05/22/2009 : 04:39:07 AM
Thanks, that's what I needed!

I had looked through the documentation and tried many variants of the range statement but what I needed was the nested form ((1,2),(2,3))[1:5] etc.

I never saw this way to do range notation in the documentation, so it would be good to include it in the future.

buck
cpyang Posted - 05/20/2009 : 2:18:46 PM
nlbegin takes an XY Range, so you need to explicitly specify X and Y columns. If your data is XYYY, then

range aa=(1,2:4)[1001:1200];

but if data is XYXYXY, then has to do

range aa=((1,2),(3,4),(5,6))[1001:1200];

There is also the notation

range aa=(?,1:end)[1001:1200];

to automatically picking up XY in worksheet but that somehow failed when row range is also specified, we will try to fix that in SR6. For now, you can use the more explicit notation to get things going.

This wiki has more explanations about using Range and XYRange in X-Functions.

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Range_Notation#Range_as_X-Function_Arguments


CP

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