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

2 views (last 30 days)
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?

Answers (1)

Steven Lord
Steven Lord on 19 Jun 2016
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

Products

Community Treasure Hunt

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

Start Hunting!