how to make a wave with number of points equal to the variable

Function nmdiff_hr()
variable i,n
wave nmdiff
wavestats/Q nmdiff
n = (V_npnts+V_numNans+V_numINFs)/24
print n
for(i=0;i<24;i+=1)
string nm = "nmdiff_"+ num2str(i)
Make/N = n $nm
wave ww = $nm
ww = nmdiff[p*24+i]
endfor
End
I can't use n in Make/N = n $nm. I'm new to program writing.

Thanks :)
nicha wrote:

I can't use n in Make/N = n $nm. I'm new to program writing.


if n is a variable or an expression instead of a number, it needs to be enclosed in parentheses:

Make/N = (n) $nm


Christian