フィルターのクリア

How to Reshape a matrix

3 ビュー (過去 30 日間)
tarmizi adam
tarmizi adam 2012 年 10 月 2 日
Hello and a nice day to all,
i have a simple question about matrices.
i have a matrix with the dimention 3-by-5:
a = [50,2,3,5,2; 35,3,2,1,3; 27,3,2,1,1]
how do i make it a column only matrix of 1-by-15 like this;
b = [50,2,3,5,2,35,3,2,1,3,27,3,2,1,1]
i've used a(:) but the the order is not what i wanted. I want it exactly to be in the same order as in matrix 'b' above. Is there a function or a simple way to do this ? thanks in advance...

採用された回答

Thomas
Thomas 2012 年 10 月 2 日
編集済み: Thomas 2012 年 10 月 2 日
use
b=reshape(a',1,[])
  4 件のコメント
Thomas
Thomas 2012 年 10 月 2 日
Notice the transpose on the a .. it is a'
reshape(a',1,[])
which gives
b = [50,2,3,5,2,35,3,2,1,3,27,3,2,1,1]
tarmizi adam
tarmizi adam 2012 年 10 月 2 日
Omg ! Silly me... Thanks tom !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by