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
 multi-function calculation within for statment
 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/19/2022 :  11:12:52 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello I'm trying to get the below script working so that the slope and the inverse slope will be valculated in rows one and two for each column 1 through "i". I keep getting the cannot assign a vector to a scaler
#Command Error!. Thanks in advance for any help with this.

page.active$ = Frequency_N_CON_T1;
for (int i = 1; i <= wks.ncols; i++ ) { range aa = [NCONT1Peak]"Center max"!$(i); range bb = [NCONT1Peak]"Peak Index"!$(i); wcol(i)[1] = movslope(aa,bb); wcol(i)[2] = movslope(bb,aa); }

ZTK

AmandaLu

439 Posts

Posted - 08/21/2022 :  11:12:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If you just need slope but not moving slope, please use “slope” function instead.

for (int ii = 1; ii <= wks.ncols; ii++ ) {
range aa = [NCONT1Peak]"Center max"!$(ii); range bb = [NCONT1Peak]"Peak Index"!$(ii); wcol(ii)[1]=slope(aa,bb); wcol(ii)[2]=slope(bb,aa);
}

https://www.originlab.com/doc/LabTalk/ref/Slope-func
https://www.originlab.com/doc/LabTalk/ref/Movslope-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