フィルターのクリア

How to convert matrix into row vector

29 ビュー (過去 30 日間)
surendra kumar Aralapura mariyappa
surendra kumar Aralapura mariyappa 2019 年 6 月 27 日
編集済み: Stephen23 2019 年 6 月 27 日
Hey all,
I have a matrix of 2*2, I need to convert into row vecotr:
A = [0 1; 2 0];
Like this I need:
A = [ 0 1 2 0];
I don't know whether it is possible or not?
A= reshape(A,1,[]);
A = A(:);
using the above things I am gettig the column or row vector like below
A= [0 2 1 0] % row vector
A = [0;2;1;0] % column vector
But I need like this
A = [ 0 1 2 0];
Any suggestions and answers are most welcomed
Thanks in Advance.

採用された回答

Stephen23
Stephen23 2019 年 6 月 27 日
編集済み: Stephen23 2019 年 6 月 27 日
>> A = [0 1; 2 0];
>> B = reshape(A.',1,[]) % you need to use TRANSPOSE!
B =
0 1 2 0

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by