chol() returns a matrix type ...

changing your final line to

   t = vcat(z)[:, 1]

avoids the explicit convert step.



i imagine there are other,
perhaps preferable, ways
to accomplish this ...



On Wednesday, January 13, 2016 at 12:48:50 PM UTC-8, Richard Dennis wrote:
>
> Why is the following not okay?
>
> s = [0.1 0.09; 0.09 0.5]
> z = chol(s)
> t = z[:,1]
>
> This gives a dimension error.
>
> The following does work
>
> s = [0.1 0.09; 0.09 0.5]
> z = chol(s)
> y = convert(Array,z)
> t = z[:,1]
>
> Somehow it seems to me that the convert() should not be needed.
>

Reply via email to