rotating N-D matrices

조회 수: 3 (최근 30일)
john creighton
john creighton 2014년 10월 17일
답변: john creighton 2014년 10월 17일
hey everyone i have 2d matrix which i have repeated 24 time using repmat function. i need to rotate each of these repeated matrices by 7.5degrees. ie 1st matrix rotated 0deg, 2nd matrix rotated 7.5deg, third matrix rotated 15deg and so on... any suggestions?

채택된 답변

Sean de Wolski
Sean de Wolski 2014년 10월 17일
Use a for-loop over the pages and imrotate
Something like:
X = your_original_2d_image
Xrot = zeros([size(X) 24],'like',X);
for ii = 1:24
Xrot(:,:,ii) = imrotate(X,7.5*ii,'crop')
end

추가 답변 (1개)

john creighton
john creighton 2014년 10월 17일
yup that worked. thanks sean

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by