How to swap multiple rows of a matrix at a time

조회 수: 12 (최근 30일)
Meghan Holland
Meghan Holland 2020년 11월 23일
댓글: Meghan Holland 2020년 11월 23일
Hi. I have a fairly large matrix (generated from an image) that I need to swap rows in. I need to swap multiple rows at a time (rows 1:63 with rows 142:201, roughly) and display this new image. I see a lot of examples of swapping indivual rows in small matrices, but nothing about swapping multiple rows at a time or swapping rows in large matrices, so how do I do this?

채택된 답변

James Tursa
James Tursa 2020년 11월 23일
편집: James Tursa 2020년 11월 23일
A = your matrix
A([1:63,142:202],:) = A([142:202,1:63],:);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by