Dimension item label error while attempting to populate output variables wave
zephyr070
•Make test=sin(x/30)
•WaveStats test
V_npnts= 128; V_numNaNs= 0; V_numINFs= 0; V_avg= 0.33891;
V_Sum= 43.3805; V_sdev= 0.582272; V_sem= 0.0514661;
V_rms= 0.671753; V_adev= 0.492791; V_skew= -0.643665;
V_kurt= -0.851805; V_minloc= 127; V_maxloc= 47;
V_min= -0.887431; V_max= 0.999991; V_minRowLoc= 127;
V_maxRowLoc= 47; V_startRow= 0; V_endRow= 127;
•Make/N=(10,4) metrics
•SetDimLabel 1,0,Vmin,metrics
•SetDimLabel 1,1,Vmax,metrics
•SetDimLabel 1,2,VminLoc,metrics
•SetDimLabel 1,3,VmaxLoc,metrics
•WaveStats test
V_npnts= 128; V_numNaNs= 0; V_numINFs= 0; V_avg= 0.33891;
V_Sum= 43.3805; V_sdev= 0.582272; V_sem= 0.0514661;
V_rms= 0.671753; V_adev= 0.492791; V_skew= -0.643665;
V_kurt= -0.851805; V_minloc= 127; V_maxloc= 47;
V_min= -0.887431; V_max= 0.999991; V_minRowLoc= 127;
V_maxRowLoc= 47; V_startRow= 0; V_endRow= 127;
•Make/N=(10,4) metrics
•SetDimLabel 1,0,Vmin,metrics
•SetDimLabel 1,1,Vmax,metrics
•SetDimLabel 1,2,VminLoc,metrics
•SetDimLabel 1,3,VmaxLoc,metrics
metrics[0][%Vmin] = V_min
Could you post the command that failed?
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 10, 2018 at 11:36 am - Permalink
As I suspected, it was a syntax error on my part. Your amended code contains a [0], and I guess I need to brush up more on that section of the help file. What does the [0] designate? I noticed the label assignment example doesn't include that character (code reposted below). Thank you very much for the help!
Make test=sin(x/30)
FindPeak/Q test
// Create a wave with appropriate row labels
Make/N=6 PeakResult
SetDimLabel 0,0,'Peak Found', PeakResult
SetDimLabel 0,1,PeakLoc, PeakResult
SetDimLabel 0,2,PeakVal, PeakResult
SetDimLabel 0,3,LeadingEdgePos, PeakResult
SetDimLabel 0,4,TrailingEdgePos, PeakResult
SetDimLabel 0,5,'Peak Width', PeakResult
// Fill PeakResult wave with FindPeak output variables
PeakResult[%'Peak Found'] =V_flag
PeakResult[%PeakLoc] =V_PeakLoc
PeakResult[%PeakVal] =V_PeakVal
PeakResult[%LeadingEdgePos] =V_LeadingEdgeLoc
PeakResult[%TrailingEdgePos]=V_TrailingEdgeLoc
PeakResult[%'Peak Width'] =V_PeakWidth
// Display the PeakResult values and labels in a table
Edit PeakResult.ld
May 10, 2018 at 01:44 pm - Permalink
Your case uses a 2D wave so two indices are needed, one for the row and one for the column.
"[0]" in John's example means "row 0".
May 10, 2018 at 01:55 pm - Permalink
Thanks,
-Kevin
May 10, 2018 at 02:11 pm - Permalink