Hello,
I have a 10x20 matrix and I`d like to change the rows randomly. For example, the 1st row will become, let`s say, the 9th, the 2nd will become the 5th, etc.
Any help?
Thank you.
Best,
Pavlos

 채택된 답변

Jiro Doke
Jiro Doke 2012년 2월 26일

30 개 추천

random_x = x(randperm(size(x, 1)), :)

댓글 수: 6

N/A
N/A 2017년 10월 24일
briliant !
Farid Khosravikia
Farid Khosravikia 2018년 1월 17일
Awesome!
A Aftab
A Aftab 2020년 4월 18일
Super!
Mohan Kumar
Mohan Kumar 2020년 4월 26일
brilliant
Sivabalan Selvarajan
Sivabalan Selvarajan 2020년 5월 31일
Worked good !
Ahmad Momeni
Ahmad Momeni 2020년 11월 9일
Perfect!

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

pavlos
pavlos 2012년 2월 28일

2 개 추천

Hello,
Yes, that worked fine.
Thank you.
Best,
Pavlos

댓글 수: 1

Jan
Jan 2012년 2월 28일
Please post a comment to an answer in the comment section for the answer. If an answer solves youzr problem, you can "accept" it to show, that no further assistence is required.

댓글을 달려면 로그인하십시오.

Zeab
Zeab 2018년 11월 7일

1 개 추천

A simple line of code working great!

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2012년 2월 26일

댓글:

2020년 11월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by