Author |
Topic |
|
j4quinn
Canada
4 Posts |
Posted - 02/13/2015 : 2:04:41 PM
|
Hello,
This code is apart of a bigger file; however, i believe i have narrowed the problem to this piece of code. The code worked for OriginPro 8.5, but fails in 2015.
The exact error is "Failed to initialize range from string, VarName = iy, VarValue = (Col(1)[dsB:dsE],Col(3)[-1:-1]) #Command Error!"
The code i believe has the problem:
// Get the beginning and ending index of data selector range into dataset objects dataset dsB, dsE; mks ob:=dsB oe:=dsE; // get index of points from data markers in data plot
window -a %(procWrkBk$); // bring workbook back to the foreground [procWrkBk$]!page.active = ii; // activate 'i'-th worksheet in workbook
// do Linear Regression analysis on the data selection fitLR iy:=( col(1)[dsB:dsE], col(3)[dsB:dsE] ); // get slope of sqrt(abs(I_D)) v.s. V_g
any suggestions would be great. How about the col(1)[dsB:deE) is that correct or do we need to give an index for datasets?
thanks in advance
|
|
j4quinn
Canada
4 Posts |
Posted - 02/15/2015 : 09:26:48 AM
|
I found this in the labtalk tutorials
"When there are no data markers on the graph, both variables are equal to -1."
However, when we run the script we do see markers on the graph and we do move them along the graph to get the indices. It appears though that the indices are not saved to the mks. Why would this happen?
|
|
|
jasonzhao
China
262 Posts |
Posted - 02/16/2015 : 02:17:22 AM
|
Hello,
Would you please see the graph below for the usage of mks;
Best regards! Jason OriginLab Technical Service
|
Edited by - jasonzhao on 02/16/2015 02:18:31 AM |
|
|
j4quinn
Canada
4 Posts |
Posted - 02/18/2015 : 11:01:25 AM
|
resolved by using ranges
// Get the beginning and ending index of data selector range into dataset objects dataset dsB, dsE; mks ob:=dsB oe:=dsE; // get index of points from data markers in data plot
// type dsB: $(dsb) and dsE: $(dsE);
window -a %(procWrkBk$); // bring workbook back to the foreground [procWrkBk$]!page.active = ii; // activate 'i'-th worksheet in workbook
range c1 = col(a)[dsB:dsE]; range c3 = col(c)[dsB:dsE];
// type c1: $(c1) and c3: $(c3);
// do Linear Regression analysis on the data selection fitLR iy:=( c1, c3 ); // get slope of sqrt(abs(I_D)) v.s. V_g
|
|
|
|
Topic |
|
|
|