how to calculate size 0f 2D (or higher) wave
Andika Asyuda
Hi all,
I am wondering if there are functions to calculate the size of 2-dimensional wave.
I am trying to create a user defined function, with 2-dimensional wave as its input. This function contains a loop , which is limited by the amount of row for the 2-dimensional wave. The unfinished code looks like this:
Function medianGaussian(JVmatrice)
wave JVmatrice // 2D wave
Variable i=0 // We use i as the loop variable.
Make/O/N=200, JV
Make/O/N=50, tempwave
do
tempwave = JVmatrice[p][i]
JV[i]=median(tempwave)
i += 1
while(i < 49)
return JV[i]
End
wave JVmatrice // 2D wave
Variable i=0 // We use i as the loop variable.
Make/O/N=200, JV
Make/O/N=50, tempwave
do
tempwave = JVmatrice[p][i]
JV[i]=median(tempwave)
i += 1
while(i < 49)
return JV[i]
End
At this version, the loop is limited at i=49. However I want to this limit to depend on the size of 2D wave, which I used the function with.
You want the dimsize function. From the command help info:
The DimSize function returns the size of the given dimension.
dimNumber is one of the following:
0: Rows.
1: Columns.
2: Layers.
3: Chunks.
For a 1D wave, DimSize(waveName,0) is identical to numpnts(waveName).
September 1, 2020 at 06:39 am - Permalink
Hi jtigor,
perfect. This is exactl what I have been looking for. Thanks
September 2, 2020 at 02:09 am - Permalink