필터 지우기
필터 지우기

How to sort a matrix in a random order

조회 수: 16 (최근 30일)
Gentrit Mehmeti
Gentrit Mehmeti 2019년 11월 11일
댓글: Gentrit Mehmeti 2019년 11월 11일
How to sort a matrix in random order?

채택된 답변

James Tursa
James Tursa 2019년 11월 11일
E.g.,
>> x = reshape(1:24,4,6)
x =
1 5 9 13 17 21
2 6 10 14 18 22
3 7 11 15 19 23
4 8 12 16 20 24
>> x(:) = x(randperm(numel(x)))
x =
7 12 3 19 16 23
20 24 10 11 1 17
21 14 8 5 13 18
6 22 15 4 2 9

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by