필터 지우기
필터 지우기

how to cyclically shift an array?

조회 수: 1 (최근 30일)
bsd
bsd 2011년 12월 11일
Hai,
I have an array of elements, I need to shift them cyclically to the left. How could I do it in matlab? Looking forward for your reply.
BSD

채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 11일

추가 답변 (1개)

Mohsen  Davarynejad
Mohsen Davarynejad 2011년 12월 11일
x = [1 : 1 : 10]
for i = 1 : 5
x = [x(2:end) x(1)]
end
  댓글 수: 1
Jan
Jan 2011년 12월 11일
The FOR loop might be confusing here. It is useful to demonstate the repeated operation only.
"1:10" is nicer and faster than "[1:1:10]".

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by