El martes, 29 de septiembre de 2015, 17:44:43 (UTC-5), feza escribió:
>
> In matlab  x = linspace(0,1,n)  creates a vector of floats of length n. In 
> julia it seems like the only way to do this is to use x = collect( 
> linspace(0,1,n) ) . Is there a nicer syntax? I do mainly numeric computing 
> and I find this quite common in my code.
>

Nobody seems to have mentioned the nicer (at least shorter) syntax:

x = [linspace(0, 1, n) ;]

Note that the ; at the end (which is the concatenation operator) will be 
required starting with the next version of Julia.

Nonetheless, I find  collect(linspace(0, 1, n)) arguably clearer.

Reply via email to