How to generate multiple random Matrices.

17 ビュー (過去 30 日間)
stephen Box
stephen Box 2018 年 9 月 13 日
コメント済み: Walter Roberson 2021 年 7 月 17 日
I'm trying to generate multiple matrices and display them in a array to use for a function. But stuck here.
for i = 1:3
x = rand(3,3);
end

採用された回答

Walter Roberson
Walter Roberson 2018 年 9 月 13 日
  3 件のコメント
chan
chan 2021 年 7 月 17 日
How can you display a number say in matrix x{1} ,i want to get the number of row 2,column 3 and how can we make a comparison between matrix x{1} element and x{2} element???
Walter Roberson
Walter Roberson 2021 年 7 月 17 日
for i = 1:3
x{i} = randi(4,3,3);
end
celldisp(x)
x{1} = 3 3 1 3 2 1 4 4 3 x{2} = 1 4 3 4 4 1 1 2 4 x{3} = 3 2 3 4 3 3 4 3 1
A = x{1}(2,3)
A = 1
B = x{2}(2,3)
B = 1
A == B
ans = logical
1
.. they happened to be the same for this randomly generated data.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by