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
 Calculations for columns in a group of three
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

vduzivatel

Czech Republic
1 Posts

Posted - 03/28/2024 :  4:57:15 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2019b (32-bit)
9.6.5.169
Operating System: Windows 11

Hi, I am looking for commands/script to calculate MEAN/100 of a group of three columns. The script should calculate the MEAN/100 for all groups in the active worksheet. The first column in the worksheet should be skipped.

What I have already written is this:

ncols=wks.ncols;
for(ii=ncols;ii>=1;ii--)
{
if (wks.col$(ii).nrows==0)
{
del col($(ii));
}
else break;
}//deletes empty columns

(wks.ncols-1)/3= //calculates the number of groups to calculate MEAN/100


I don't know how to continue further. AI didn't help.



jasmine_chan

China
Posts

Posted - 03/29/2024 :  02:53:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Compute descriptive statistics on columns, you can use stats X-Fuction.

range rr = [book2]Sheet1!($(ii):$(ii+2)); //put 3 columns in a range
stats ix:=rr mean:=t_mean; //get mean to t_mean
t_mean = t_mean/100;
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