how to use circshift in matlab
이전 댓글 표시
I have a array of indeces, so they must be positive, but some of them are negative, for instance for a array of m elements, I want to say if i=-1 put i=M-1, and if i=-2 put it M-2, how can I use circshift?
댓글 수: 3
Image Analyst
2012년 12월 21일
편집: Image Analyst
2012년 12월 21일
Please give an example. Just saying "put it M-2" is not descriptive enough. circshift works on the whole array, it does not use different shifts on an element by element basis.
ss
2012년 12월 21일
Image Analyst
2012년 12월 21일
I think Matt is right - you want mod(), not circshift().
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!