Effacer les filtres
Effacer les filtres

why is this code not giving the output?

1 vue (au cours des 30 derniers jours)
bsd
bsd le 26 Oct 2011
Hai,
I have typed this code;
A=@(x)[cos(x),-sin(x),0;sin(x),cos(x),0;0,0,1]; B=@(x)(A*[10;20;30])
After the above step, matrix B is not displayed as a function of x. Why is it so? Are the two matrices getting multiplied or not?
I need the resultant matrix as a function of x, because I need to do integration for each term in the resultant matrix.
Here the matrix [10;20;30] need not be so, they can be any constant values.
Looking for your reply.
BSD

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 26 Oct 2011
A is an anonymous function. You need to modify your B.
A=@(x)[cos(x),-sin(x),0;sin(x),cos(x),0;0,0,1];
A(pi/2)
B=@(x)(A(x)*[10;20;30]);
B(pi/2)

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by