Author |
Topic |
|
ipc2uka
Germany
Posts |
Posted - 10/17/2005 : 1:12:55 PM
|
Origin Version (Select Help-->About Origin): 7 SR 4 Operating System: XP
I have some 10 worksheets with same x value ranges and different y values each. To every data set, there corresponds a different parameter m.
In order to create a 3d contour plot (y vs. x/m) I need to create a matrix. The easiest way to get it is to have all the data in one worksheet of the following format, I assume: col1(X) col2(Y) col3(Z) ---------------------------- 1 m1 z(1,m1) 2 m1 z(2,m1) 3 m1 z(3,m1) 1 m2 z(1,m2) 2 m2 z(2,m2) 3 m2 z(3,m2) 1 m3 z(1,m3) 2 m3 z(2,m3) 3 m3 z(3,m3)
Then the worksheet can be converted by "ConvertToMatrix/RandomXYZ".
I have the following question: - Is there some program/macro/.. to merge the worksheets? I assume there is already several people who have encountered the same problem...
- Do I run into trouble managing the amount of data (x=1..2000 and m values are not regularly spaced (1,2,3,10,100,1000), so there have a lot of columns to be created in order not to loose information
- ..or is there a much more easy way to get the 3d graphs
Thank you for your help
|
|
Mike Buess
USA
3037 Posts |
Posted - 10/17/2005 : 4:30:22 PM
|
It's easy to stack any number of worksheets to form your X and Z columns with a LabTalk or OriginC script. You only need to supply the wks names. The tricky part is supplying the corresponding Y values (m1, m2, ...). The following LT script uses a list (%L) of worksheet names and a vector (yy) composed of the m values. There might be more efficient methods depending on how you've named your worksheets but this is probably a good place to start.
%L=Data1 Data2 Data3 Data4 Data5 Data6; yy={1, 2, 3, 10, 100, 1000}; win -t D; // create a new wks %W=%H; // save its name wks.addcol(C); // add a column wks.col3.type=6; // make it a Z column %A=%[%L,#1]; // name of first wks tmp=data(1,%A!wks.maxrows); // temporary dataset for(i=1;i>0;i++) { %A=%[%L,#i]; // ith wks if(%A=="") break; tmp=yy[i]; copy -a %(%A,1) %(%W,1); copy -a tmp %(%W,2); copy -a %(%A,2) %(%W,3); }; del tmp; del yy;
Mike Buess Origin WebRing Member |
|
|
|
Topic |
|
|
|