Prevent repeating number in any matrix row

Hi all, If I have any random matrix: [2 4 5 6 4; 3 5 3 2 6] The numbers 4 and 3 are repeated in rows one and two, respectively. I would like some help in being able to prevent this repeating. The randperm function is okay for doing the requirement in vectors. Is it okay here in a matrix? your help is appreciated. Hany

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2017년 7월 12일
편집: Andrei Bobrov 2017년 7월 12일

1 개 추천

[~,out] = sort(rand(2,5),2);

댓글 수: 1

hany salem
hany salem 2017년 7월 12일
Thanks sir. how to determine the lower and upper limits for the random numbers?

이 질문은 마감되었습니다.

태그

질문:

2017년 7월 12일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by