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
 How to plot graph function with changing parameter

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
Insomnia Posted - 09/26/2003 : 11:41:37 PM
I would like to plot a series of graph functions, say y=a+bx where range of x is fixed but many different pairs of parameter a and b. Three columns in the worksheet are ready, col(A) for x, col(B) for parameter a, col(C) for parameter b. So far, I can only add the graph function one by one, like y = a(i) + b(i)x, is there any better solution? Many thanks in advance.

1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 10/15/2003 : 11:27:44 AM
Origin can define functions and will display those functions for the X range if a graph window is active.

So, we don't even need an X column. Here is a script that plots all the functions (I assume there are two columns - one for each parameter - in the worksheet window which is active):

// BEGIN SCRIPT
%M=%H; // Get the Worksheet name
get col(1) -e end; // How many rows of values
win -t plot line Functions; // Open a new Line graph window
getn (X Minimum) XMin (X Maximum) XMax (Enter X Range); // Prompt
X1=XMin;
X2=XMax;
queue {
loop(ii,1,end) {
F$(ii)(X) = %(%M,1,ii) + %(%M,2,ii)) * X; // Create functions
}
}
doc -uw;
layer -a; // Rescales Y
// END SCRIPT

NOTE: Once you've done this, Origin does not allow you to re-define the function. You first must delete the function(s) with:
delete F1
or
loop(ii,1,10) {delete F$(ii);}




Edited by - greg on 10/22/2003 10:02:57 AM

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