avoiding same data in looping

1 Ansicht (letzte 30 Tage)
Muammar
Muammar am 26 Nov. 2011
Hii... I am a very new MATLAB user, I want to ask how to avoid same data when I do random looping, Example, I have A = [ x y z], I want to do looping, but every value does not have same value, ex: if I have data from 1 to 3, if x=1, y and z should not be 1 (should be 2 or 3). How to make the m-file?
Thank You

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 26 Nov. 2011
For A=1:3
fprintf('The value of A is: %d\n',A);
end
  3 Kommentare
Fangjun Jiang
Fangjun Jiang am 26 Nov. 2011
For that, you can use randperm(N), e.g. A=randperm(3)
Muammar
Muammar am 27 Nov. 2011
Thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by