How can I get the length of a wave so I can use it in an operation?
Hello,
I'm writing a program where the user inputs a delimited text file with multiple columns, imports those columns as waves, and then operates on them in various ways to get results out.
However, my issue is that my input files are not bound to be a specific length. For my working example below, I've imported two waves, "sig" and "ref". They both have the same length N, but it might be different the next time I use the program. How can I initialize or redimensionalize the resultant wave "sigRef = sig/ref" so that it has the same number of data points as sig and ref?
In other software languages, I could so something like "length.array" or "size(array)". I can't find functions like that in the documentation.
Thank you!
Roy
Make/O sig
Make/O sigRef
String columnInfoStr = ""
columnInfoStr += "C=1, N=ref;"
columnInfoStr += "C=1, N=sig;"
LoadWave/A/J/D/O/E=1/K=1/B=columnInfoStr "HD:...:file.txt"
sigRef = sig/ref
We call that function "numpnts()". Just to confuse you :)
For multidimensional waves there is also the DimSize() function.
June 18, 2019 at 11:43 am - Permalink
I thought I scoured the whole Igor reference PDF, but I missed the whole "About Waves" section.
Thank you very much!
Cheers,
Roy
June 18, 2019 at 03:16 pm - Permalink
It's a big manual. Lots of functions and operations!
June 18, 2019 at 05:23 pm - Permalink