I'm really struggling here, I can't seem to figure out how to create an 11x11 matrix with the numbers 1-121 in row major order and column major order. I cannot use the reshape command, and I am trying to work with ones, zeros, transpose, cumsum, cumprod, and several other similar commands. I really can't figure it out.

 採用された回答

Walter Roberson
Walter Roberson 2015 年 10 月 16 日

0 投票

A = zeros(11,11);
A(:) = 1 : 121;

1 件のコメント

Francisco Angel
Francisco Angel 2017 年 11 月 17 日
and B = A'; to get the other order??

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by