필터 지우기
필터 지우기

Swap the First and Last Column (CODY)

조회 수: 2 (최근 30일)
Saviyo Therattil
Saviyo Therattil 2021년 6월 7일
답변: KSSV 2021년 6월 7일
function B = swap_ends(A)
X = A(:,end);
C = A(:,1);
A(:,1) = X;
A(:,end) = C;
B = A;
end
How do I reduce it into a length of 7? (Top length is 7).

답변 (1개)

KSSV
KSSV 2021년 6월 7일
A = rand(1,5) ;
A([1 end]) = A([end 1])

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by