Author |
Topic  |
|
abreiti
Germany
Posts |
Posted - 12/11/2006 : 08:49:31 AM
|
Hello,
I have different datasets in one layer, but with different x-values. For further jobs, I need to calculate the mean y-value of every x-value. Is there a possibility to get all x-values together in one column, to calculate the associated mean y-values afterwards?
Thanks Alex |
|
Mike Buess
USA
3037 Posts |
Posted - 12/11/2006 : 11:32:19 AM
|
Hi Alex,
The following script interpolates all datasets over the same X values and performs Statistics on Rows on the results...
nn=100; // number of X values (adjust to suit) xx1=layer.x.From; // first X value xx2=layer.x.To; // last X value xxi=(xx2-xx1)/(nn-1); // X increment %Z=""; lay -c; win -t D; %W=%H; col(1)=data(xx1,xx2,xxi); wo -a count-1; loop(i,1,count) {wcol(i+1)=%[%Z,#i](col(1))}; wo -s 2 0 wks.ncols 0; // select all Y columns run.section(WKS,DescStats,1); // statistics on rows wks.col1.name$=A; // rename column 1 col(1)=%(%W,1);
Mike Buess Origin WebRing Member |
 |
|
|
Topic  |
|
|
|