MATLAB Answers

0

rotating N-D matrices

Asked by john creighton on 17 Oct 2014
Latest activity Answered by john creighton on 17 Oct 2014
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?

  0 Comments

Sign in to comment.

2 Answers

Sean de Wolski
Answer by Sean de Wolski
on 17 Oct 2014
 Accepted Answer

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

  0 Comments

Sign in to comment.


Answer by john creighton on 17 Oct 2014

yup that worked. thanks sean

  0 Comments

Sign in to comment.