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
 Origin Forum
 loop sum
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zknauss

USA
72 Posts

Posted - 08/21/2022 :  10:36:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I seem to be running into an issue with looping columns through the sum function below is my script. I keep getting an output of the number in row 1 of each column i. Thanks

for (int i = 1; i <= wks.ncols; i++ ) { range bb = [NCONT1Peak]"Peak Index"!col($(i)); range ff = [NFreReg]"Frequency_N_CON_T1"!$(i)[4];

ff = sum(bb)^2; }

ZTK

AmandaLu

439 Posts

Posted - 08/21/2022 :  10:46:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please use Total function instead of Sum.
https://www.originlab.com/doc/LabTalk/ref/Total-func
https://www.originlab.com/doc/en/LabTalk/ref/Sum-func

Thanks,
Amanda
OriginLab Technical Service

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