Print in Command Line
JoeKo91
Hello,
I apologize in advance for the simple question, but I'm having some growing pains learning Igor syntax basics. For example, I'm simply trying to print the median of a wave in the command line but I keep running into error messages. I'm typing something like this in the command line:
Print StatsMedian('wave1')
I keep getting a syntax error that says, "wave name expected" and I don't understand why it keeps doing this when I am providing the name of the wave within the parentheses. Can someone please help me understand the syntax nuance here? I'm used to programming in Matlab, R, or Python but a lot of times, Igor just throws me off.
Thanks!
Are you certain that wave1 exists? Is it in the current data folder? Look in the Data Browser- is the red arrow next to a data folder containing your wave1?
July 24, 2018 at 11:09 am - Permalink
Also your command is showing single quotes.
Try: Print StatsMedian(wave1) no quotes around wave name.
Andy
July 24, 2018 at 01:16 pm - Permalink
In reply to Also your command is showing… by hegedus
If there's really a wave1 in the current data folder, I think the single quotes around the name should still work. (They let you call waves with odd names like '012', in addition to regular names.) It looked wrong to me at first too, having avoided that syntax for my whole Igor life.
July 24, 2018 at 01:37 pm - Permalink
In reply to If there's really a wave1 in… by gsb
Yes, the single quotes don't matter if the name is not a liberal name. They are required if the name is liberal, and tolerated otherwise.
We agree that liberal names are rarely worth the extra effort.
July 24, 2018 at 02:25 pm - Permalink
Ah, silly me. The proper data folder wasn't selected in the data browser! Thank you all for the input. For sake of thoroughness, I'll also mention that the single quotes were needed for my case.
July 24, 2018 at 03:26 pm - Permalink