how to multiply a symbolic matrix involving cosinus by its transposed?

4 次查看(过去 30 天)
I want to multiply a matrix by its transposed in order to knwo if it verify Q<sup>t</sup>Q=I.
Yet when I compute it on matlab I get something strange using a concept I'm not aware of: `conj(x)` which seems to be the complex conjugate.
- Therefore, how to multiply a matrix by its transposed?
Here is the code I tried:
>> syms x
>> A=[cos(x) -sin(x);
sin(x) cos(x)]
A =
[ cos(x), -sin(x)]
[ sin(x), cos(x)]
>> A'*A
ans =
[ cos(conj(x))*cos(x) + sin(conj(x))*sin(x), sin(conj(x))*cos(x) - cos(conj(x))*sin(x)]
[ cos(conj(x))*sin(x) - sin(conj(x))*cos(x), cos(conj(x))*cos(x) + sin(conj(x))*sin(x)]
I should have had 1 at the top left corner, isn't it?

回答(1 个)

Steven Lord
Steven Lord 2016-6-19
Nope. I know you're thinking that cos(x)^2+sin(x)^2 = 1 but that's not what you have. Try using subs to substitute 1+1i into the product for x. Now if you used the .' operator (instead of ') or if you declared x as a real value, simplifying the product with simplify you'd receive the result you expect.
syms x real

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by