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
 Analysis on column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Karlito

Germany
Posts

Posted - 08/23/2004 :  07:01:35 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hallo
Would anybody please know how to write a script for a certain procedure please. I acquire a MFC data via a DAQ board. The data is xyyyy data where the x is time and the yyyy are values of respective MFC channels. The scanning rate is lets say every 100 ms. Is there a way to calculate automatically an average value of each channel in an increment of 20 minutes. So it would scan the channels from row one to 12000 calculate an average value for each channel on this add these somewhere to a column etc. Then from row 12001 to 24000 calculate the averages again and so on till the end of the worksheet (app. 750 000 rows).
Thank's a lot for any suggestions
Sincerely Karlito

Mike Buess

USA
3037 Posts

Posted - 08/23/2004 :  07:31:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Karlito,

This will duplicate the MFC worksheet and average each column 12000 rows at a time...

nn=12000;
get col(1) -e npt; // total # of rows
win -d; // duplicate wks
doc -e W {%W=%H}; // %W is name of new wks
loop (i,1,wks.ncols) {
%(%W,i) = ave(%(%H,i),nn);
};
set %W -er npt/nn; // remove unecessary rows
win -a %W; // activate the results


Mike Buess
Origin WebRing Member
Go to Top of Page

Karlito

Germany
Posts

Posted - 09/06/2004 :  07:57:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Mike

Thank you very much for your hint. It does exactly what I wanted to do.

Sincerely

Karlito
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