Help with waves and single quotes
belalula
Function cut(w1,w2)
wave w1, w2
duplicate/o/R=[w2[2]*10, w2[5]*10] w1 $(nameOfwave(w1)+"_05_1")
duplicate/o/R=[w2[3]*10, w2[6]*10] w1 $(nameOfwave(w1)+"_1_0.5")
duplicate/o/R=[w2[4]*10, w2[7]*10] w1 $(nameOfwave(w1)+"_0.5_0.75")
SetScale/P x 0,0.0001,"s", $(nameOfwave(w1)+"_05_1")
SetScale/P x 0,0.0001,"s", $(nameOfwave(w1)+"_1_0.5")
SetScale/P x 0,0.0001,"s", $(nameOfwave(w1)+"_0.5_0.75")
end
The waves I end up with are displayed in graphs with single quote around them, which is not the case in the data browser. It is not an issue generally (even though I'd like to understand why this happens) but now I want to run a piece of code which grabs waves in a graph from the root to average them. Here it gives me an error : root:w1_1_0.5 missing for example. Even though it's clearly in the root folder.
WHat is the issue here?
thanks for the help!
DisplayHelpTopic "Programming with Liberal Names"
April 21, 2013 at 05:39 pm - Permalink
BTW, I avoid code like this:
in favor of this:
name = nameOfwave(w1)
name += "_1_0.5"
duplicate/o/R=[w2[2]*10, w2[5]*10] w1, $(name)
The latter style makes it possible to see in the debugger what the name actually is as well as to print out the name for debugging purposes.
April 21, 2013 at 06:39 pm - Permalink