| Author |
Topic  |
|
|
byrdin
France
18 Posts |
Posted - 03/10/2006 : 04:32:11 AM
|
Origin Version (Select Help-->About Origin): 7.0552 Operating System: xp pro
i fitted multiple datasets with a biexponential. now i want to reorganize the values in the parameter worksheet so that i can plot the amplitudes of the two phases as function of the dataset number. That is: all A1 in one column, all A2 in another and the corresponding lifetimes in the column label. thats easily done if you know which parameter is where.
For a script in the more general case of multiple parameters, to put things in the right columns,(i guess) i have to use the variable names in the first column of the parameter worksheet. There,in my example, in the third line is written "t1" and in the fifth is written "t2". BUT: %(parameters1,1,3) == %(parameters1,1,5) gives true! what does that mean and how do you deal with it? |
|
|
fzimnoch
USA
28 Posts |
Posted - 03/20/2006 : 2:07:29 PM
|
Hello Byrdin:
The worksheet created by the advanced curve fitter is just an ordinary worksheet so it's values can be addressed or set as with other worksheets.
Perhaps you should consider using the Labtalk %( ) Substitution notation.
So during script execution, a ‘worksheet information expression’ surrounded by %() is evaluated and replaced with the worksheet information it represents.
To return individual cell contents, use the following syntax:
%(worksheetName, columnNumber, rowNumber);
For example, if the third cell in the fourth column in the data1 worksheet contains the value 25, then entering the following statement in the Script window:
A = %(data1, 4, 3)
sets A equal to 25.
The %() substitution notation can be combined with system variables. For example, entering the following script in the Script window:
%(%H, selc1, selr1) =
returns the element in the top left cell of the current selection range.
To return the contents of a text cell, use a string variable:
%A = %(data1, 4, 3); %A =
I hope this helps.
FRED |
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 03/20/2006 : 4:05:45 PM
|
quote: For a script in the more general case of multiple parameters, to put things in the right columns,(i guess) i have to use the variable names in the first column of the parameter worksheet. There,in my example, in the third line is written "t1" and in the fifth is written "t2". BUT: %(parameters1,1,3) == %(parameters1,1,5) gives true!
In order to compare two string variables you need to quote both variables...
if( "%(parameters1,1,3)"=="%(parameters1,1,5)" ) type TRUE; else type FALSE;
Likewise with Fred's method...
%A=%(parameters1,1,3); %B=%(parameters1,1,5); if( "%A"=="%B" ) type TRUE; else type FALSE;
...If you are comparing a string variable with a string (constant) you don't need to quote the variable. In other words, this test will work...
if( %(parameters1,1,3)=="t1" ) type TRUE; else type FALSE;
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 03/20/2006 4:20:56 PM |
 |
|
| |
Topic  |
|
|
|