Info

この質問は閉じられています。 編集または回答するには再度開いてください。

To pick random data

1 回表示 (過去 30 日間)
Muruganandham Subramanian
Muruganandham Subramanian 2012 年 2 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hai all,
I have an sample matrix e.g.
a=[1 2 -8 9 0 5] & b=[6 7 1 5 8]. (a & b matrix will vary, when iteration changes).In these two matrices, i need to pick the data randomly, when any of the data in two matrices are equal

回答 (1 件)

Grzegorz Knor
Grzegorz Knor 2012 年 2 月 27 日
a=[1 2 -8 9 0 5];
b=[6 7 1 5 8];
imax = 10;
if any(ismember(a,b))
a = randi(imax,size(a));
b = randi(imax,size(b));
end
Is this the solution to your problem?

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by