Author |
Topic |
|
jeffsecor
USA
1 Posts |
Posted - 06/17/2013 : 1:02:16 PM
|
Hello, This may be a basic question , but I can't find a basic answer anywhere.
I am using the 3d parametric plot in origin9. As a test, I am making a paraboloid. So x(u,v)=u , y(u,v)=v and z(u,v) is my question.
In the script before window, I made a test function \double a; double b; function double test(a,b,u,v) { return a*u^2+b*v^2 } \ Now if I enter into the z(u,v) window something like test(1,2,u,v)
It will correctly plot the paraboloid with parameter "a" as 1 and parameter "b" as 2. What I want to do is enter a column name into the z(u,v) box. i.e. I have a book with column named NY, and another column named MEX, each with two rows for the paraboloid parameters. I expect the code something like
z(u,v)= test(Col(MEX),u,v) ---before script window--- double a; double b; function double test (Col(NAME),u,v) { a=Col(NAME)[1]; b=Col(NAME)[2]; return a*u^2+b*v^2 }
But I dont know the correct syntax to do this, i.e. have a column as a parameter and a general column designation in the function code.
Jeff Secor |
|
greg
USA
1378 Posts |
Posted - 06/19/2013 : 10:35:23 AM
|
The first two arguments (a and b) defaulted to type double and you cannot use a dataset for both and expect origin to understand you mean to use the first two rows of the dataset.
In the Before Formula Script, add this line:
range raMex = [Book1]Sheet1!Mex;
Then for z(u,v) you can use:
test(ramex[1],ramex[2],u,v)
As you change the two values in the MEX column, your graph should update automatically. |
|
|
|
Topic |
|
|
|