multiplying matrices with an array in order to create a rotation matrix
이전 댓글 표시
Hi!
We are looking for a way to create a rotation matrix within a for loop.
matrixRy=(1-cos(hoeky))*matrixKy^2+sin(hoeky)*matrixKy+matrixI
The sizes of the variables are: hoeky: 1x1827 double matrixKy: 3x3 matrixI: 3x3
We would like to create 1827 different matrixRy with a size of 3x3. Is this possible?
Thanks in advance!
Kind regards
댓글 수: 2
KSSV
2017년 5월 23일
You want to generate those many number of Rotation matrices? Rotate the given data by certain angle and get new data points?
Lotte Stam
2017년 5월 23일
답변 (1개)
Andrei Bobrov
2017년 5월 23일
편집: Andrei Bobrov
2017년 5월 23일
Ky = matrixKy^2;
h = reshape(hoeky,1,1,[]);
matrixRy = (1-cos(h)).*Ky + sin(h).*matrixKy + matrixI; % MATLAB >= R2016b
matrixRy = bsxfun(@plus,bsxfun(@times,(1-cos(h)),Ky) +...
bsxfun(@times,sin(h),matrixKy), matrixI); % MATLAB <= R2016a
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!