On Tue, Oct 27, 2015 at 5:47 AM,  <michael.cr...@gmail.com> wrote:
> I have a function that expects a Matrix argument, but for the case I'm
> working on, the natural way to construct the argument gives a vector. So,
> suppose I have a vector, e.g., a=rand(10). What is the best way to convert
> this to a 10X1 array? I can do it using a loop, but I thought there might be
> a built-in convertor, which I fail to find.
> Thx

reshape(a, (10, 1)) if you don't mind the two to share the same
storage and you cannot resize the first one anymore.

Reply via email to