hello,
this used to work (never mind details, edited down to bare minimum here):
Function mc(B,Bphi)
Wave B
Variable Bphi
Wave calc,B1
B1 = B / Bphi
calc= - mcF(B1)
return calc
End
It now returns "ambiguous wave point number" pointing to the B in B1 = B / Bphi. I gather things have changed in how waves are multipled by constants, so, I changed B1 from variable to wave. That moves the (same) error to "return calc". Ultimately what I want is to give the function mc a wave, B, of various values, and Bphi, a specific number, and then get back a wave after minor calculations (note mcF is defined elsewhere, and works fine). I always assumed the way this worked was IGOR implicitly took each point in B, operated on it with the variable Bphi and function mcF, and point-by-point returned the desired wave.... Any assistance navigating what is certainly a basic programming issue would be greatly appreciated!
thank you---
Hi,
In the function it is expecting a single value in the return statement, but you are giving a wave.
If you want to return a wave then use
Function /wave mc(B,Bphi)
.....
return calc
end
Andy
June 26, 2018 at 06:46 pm - Permalink
June 26, 2018 at 07:20 pm - Permalink