I have a 512x512x100 matrix A which contains a 100x100x20 submatrix S. I want to translate (and rotate) S. In few words, the final result must be a 512x512x100 matrix containing S, but in a different position (and if possible, rotated). How can I do that?

댓글 수: 4

Stephen23
Stephen23 2018년 4월 12일
편집: Stephen23 2018년 4월 12일
  • Translation: perhaps using indexing, or interpolation. What happens to the elements where the subarray used to be: do they keep their values, or get new values?
  • Rotation: by multiples of 90 degrees, or by any arbitrary angle?
Friend
Friend 2018년 4월 12일
편집: Friend 2018년 4월 12일
  • They get new values (zeros)
  • If possible, any arbitrary angle
PS: the only non-zero values contained in A, are inside S.
Stephen23
Stephen23 2018년 4월 12일
  • Translation: depending on your requirements you could use indexing, or circshift. What happens if the new subarray position lies across/outside the array dimensions?
  • Rotation of a array by an arbitrary angle is not clearly defined:
Friend
Friend 2018년 4월 12일
  • It's true, I solved the translation problem through simple indexing.
  • I had a feeling that rotating by an arbitrary angle wouldn't be possible. I'll try with 90° rotations. thanks

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2018년 4월 12일

댓글:

2018년 4월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by