Change row vector to column vector

后端 未结 3 1054
天涯浪人
天涯浪人 2020-12-17 20:28

How can I change this into a column, at the moment all 750 entries are on one row?

p = normal(1:750)-1;

I have tried:

colum         


        
3条回答
  •  失恋的感觉
    2020-12-17 20:46

    It is common practice in MATLAB to use the colon operator : for converting anything into a column vector. Without knowing or caring if normal is a row vector or a column vector, you can force p to be a column vector, like so:

    p = p(:);
    

    After this, p is guaranteed to be a column vector.

提交回复
热议问题