Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

To pick random data

조회 수: 2 (최근 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