[Thread Prev][Thread Next][Index]

Re: ones(m,1)



On Tue, 22 Mar 2005, David Darr wrote:
> This is probably easy but I couldn't think of a straight forward way to do 
> it. I would like to generate a field like the one generated by the 
> ONES(M,1) function in Matlab. That is, an Mx1 array (where M is arbitrary, 
> but specified) populated entirely by "1.0" (or any other constant value 
> for that matter).

let m = 100
let ones = 1 + 0*x[gx=1:`m`:1]

Or similarly: y[gy=...], z[gz=...], t[gt=...].

Andrew



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement