How to write multiple rows in a multiple column way without changing the order

 採用された回答

James Tursa
James Tursa 2017 年 10 月 4 日
result = reshape(A.',1,numel(A));

2 件のコメント

Muhammad Usama Usman
Muhammad Usama Usman 2017 年 10 月 4 日
Thnaks. I understand the row to column and numel operation. What is 1 for ? Number of rows ?
James Tursa
James Tursa 2017 年 10 月 4 日
編集済み: James Tursa 2017 年 10 月 4 日
Yes, the 1 is the number of rows, and numel(A) is the number of columns. The initial transpose is to get the row elements of the original A to be next to each other in memory so they will appear next to each other after the reshape.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by