| Author |
Topic  |
|
|
mej
Albania
Posts |
Posted - 01/21/2004 : 12:15:28 PM
|
Hello
I want to fit 33 datasets with the same x values and i use this script
loop(n,1,33){ StartRange=0.5; EndRange=0.9; mks1=xindex(StartRange,data_a); // data_a is the x value mks2=xindex(EndRange,data_a); doc -uw; lr data_int$(n); // data_int$(n) is the y values };
But the result is not correct |
|
|
Mike Buess
USA
3037 Posts |
Posted - 01/21/2004 : 3:36:09 PM
|
1. mks1 and mks2 are usually reserved for use with the data selector tool. When using lr in a loop it's probably better to specify the range on the command line as shown below. 2. xindex uses a Y dataset as the argument, not the X dataset. Since the X values are shared by all Y datasets you only need to get the start and stop indices once.
StartRange=0.5; EndRange=0.9; i1=xindex(StartRange,data_int1); i2=xindex(EndRange,data_int1); loop (n,1,33) { lr data_int$(n) -b i1 -e i2; type $(n): $(lr.a), $(lr.b); // dataset #: intercept, slope };
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 01/21/2004 6:32:53 PM |
 |
|
|
mej
Albania
Posts |
Posted - 01/22/2004 : 11:07:35 AM
|
It is OK but the linear fit does not appear in the graphs previously ploted in each graph Thanks |
 |
|
| |
Topic  |
|
|
|