reshape a column vector in a row-wise direction?

14 ビュー (過去 30 日間)
Ernest Adisi
Ernest Adisi 2018 年 8 月 16 日
編集済み: James Tursa 2018 年 8 月 16 日
if I have column vector A= 1;2;3;4;5;6;7;8;9;10 how do I get matlab to reshape it in the row wise direction so it becomes
A= 1 2 3 4 5
6 7 8 9 10
as the reshape function seems to take it in column wise direction format?

採用された回答

KSSV
KSSV 2018 年 8 月 16 日
A= [1;2;3;4;5;6;7;8;9;10 ] ;
B = reshape(A,[],2)'
  3 件のコメント
Ernest Adisi
Ernest Adisi 2018 年 8 月 16 日
hey thanks for answering, if i want it reshaped with a certain row r column c, would it be reshape(A,[],r,c)'. I have to import data from a column vector into a certain r and c
Ernest Adisi
Ernest Adisi 2018 年 8 月 16 日
oh got it now thanks

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by