
error: expected wave name----help

shuiye
I wrote a procedure to deal with my experiment data.
When running it, the error message "expected wave name" popped up.
I attached the file and error message below.
Could anyone take a look and help me out.
Thanks,
Felix
-----------------------------------
#pragma rtGlobals=3 // Use modern global access method and strict wave access. function experiment20151116_RBS_Chi_Cal(r1,c1,c2,c3,c4,c5) wave r1, c1, c2, c3, c4, c5 make /O/N=5 chi_all string thewave variable index //---------loop----------------- for(index=1; index<6;index+=1) thewave="c"+num2str(index) duplicate $thewave, w //error: expected wave name chi_all[index-1]=RBS_Chi_Cal(r1,w,670, 720)//call "RBS_Chi_Cal" function endfor //---------loop------------------ edit chi_all end

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
November 20, 2015 at 04:33 pm - Permalink
Thanks for promote reply. I tried again. There's still something not right.
Error message shows:"while executing duplicate, the following error occurred: expected wave name."
November 20, 2015 at 04:56 pm - Permalink
That's not really something that WAVE w=$str is designed to do.
You can assign WAVE references, though, so something like:
may be what you need to do.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
November 20, 2015 at 08:39 pm - Permalink
Have a look at the /WAVE options:
DisplayHelpTopic "Wave Reference Waves"
HJ
PS - Bonus: You are "not" limited by the amount of waves to pass.
November 23, 2015 at 07:42 am - Permalink
But I am still wondering if there's some way that I don't need to assign the value to "wave reference wave" value one by one.
5 items is fine in this case, but 100 items would kill me.
November 23, 2015 at 01:51 pm - Permalink
The only way I see that this works is when c1 ... cN are waves that are only 1 point long or contain exactly the same value. Otherwise, it is entirely confusing. Please tell us what c1 ... cN really are. Are they waves that have only 1 point in them or waves that have the same value in them?
Also, please tell us what the function RBS_Chi_Calc(...) takes as input. As near as I can tell, it must take a wave and three variables.
The best I can guess is that you probably want something like this ...
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
November 23, 2015 at 03:58 pm - Permalink
HJ
November 24, 2015 at 03:00 am - Permalink