フィルターのクリア

how to generate matrix of size 10X10?

43 ビュー (過去 30 日間)
asram eluru
asram eluru 2014 年 3 月 26 日
コメント済み: Walter Roberson 2023 年 2 月 21 日
I have generated the numbers from 1 to 10 by using the command 1:1:10. I got 1X10 size matrix but I want the matrix of size 10X10 i.e, each column values should be same. Please help me.
  1 件のコメント
Chandrasekhar
Chandrasekhar 2014 年 3 月 26 日
ones(10,10) will generate a 10x10 matrix

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

回答 (2 件)

Andrei Bobrov
Andrei Bobrov 2014 年 3 月 26 日
one way
ones(10,1)*(1:10)
  2 件のコメント
Ankita Kalra
Ankita Kalra 2017 年 10 月 16 日
Dera Andrei, I need 1 to 10 values in a column of a 10x10 matrix (without the use of for loop).
Walter Roberson
Walter Roberson 2017 年 10 月 16 日
Transpose the result of the above. Or use (1:10).' * ones(1,10)

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


Julie
Julie 2023 年 2 月 21 日
編集済み: Julie 2023 年 2 月 21 日
there is a simple and easy way by typing magic(x) on the command window
x means how many rows and columns in a matrix do you want, for example, if you want to build a 10x10 matrix, you just need to type magic(10) on the command window, then you will get what you want.
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 2 月 21 日
The user needed a specific matrix in which all of the columns were the same

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

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by