Prevent repeating number in any matrix row
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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
Answers (1)
Andrei Bobrov
on 12 Jul 2017
Edited: Andrei Bobrov
on 12 Jul 2017
[~,out] = sort(rand(2,5),2);
1 Comment
hany salem
on 12 Jul 2017
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!