The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 get all x-values of the layer
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

abreiti

Germany
Posts

Posted - 12/11/2006 :  08:49:31 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000