Solving Complex Matrix Operations

조회 수: 5 (최근 30일)
Missael Hernandez
Missael Hernandez 2020년 3월 4일
댓글: Missael Hernandez 2020년 3월 4일
I have tried everything!

채택된 답변

Fabio Freschi
Fabio Freschi 2020년 3월 4일
You can do this in a for loop or using arrayfun
% your A vector
A = rand(1,1001); % dummy vector
% calculation of the matrix B
B = arrayfun(@(a)[cos(-a) sin(-a) 0; -sin(-a) cos(-a) 0; 0 0 1],A,'UniformOutput',false);
Than you can access each matrix using the {} indexing, e.g. the first matrix is
B{1}
etc
  댓글 수: 5
Fabio Freschi
Fabio Freschi 2020년 3월 4일
Add
R = cellfun(@(Rx,Ry,Rz)Rx*Ry*Rz,Rx,Ry,Rz,'UniformOutput',false);
Missael Hernandez
Missael Hernandez 2020년 3월 4일
what if I want to multiply each individual R by another vector?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by