# Arranging of variable submatrices into main matrix results in forming cos(conj(theta))

조회 수: 1(최근 30일)
Bathala Teja 2021년 9월 8일
댓글: Bathala Teja 2021년 9월 8일
In my script, i formed matrices G_ss, G_sr, Grs, Grr(all are 3*3) in terms of theta.
i am doing differentiation operation w.r.t theta for all matrices then i am getting Gd_ss, Gd_sr, Gd_rs, Gd_rr matrices after differentiation.
Finally i am forming single matrix G = [Gd_ss Gd_sr; Gd_rs Gd_rr]
I have to get G matrix interms of theta. But in the result it is showing cos(conj(theta)), sin(conj(theta))......etc, terms instead of cos(theta), sin(theta).
Where it went wrong i dont know.
Even after differentiation operation, Gd_ss, Gd_sr, Gd_rs, Gd_rr matrices are in theta only not like conj(theta).
After forming G only it is showing conj(theta). How to rectify this??

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

### 채택된 답변

Walter Roberson 2021년 9월 8일
Somewhere in your calculation, you have the ' (conjegate transpose) operator instead of the .' (non-conjugate transpose) operator.
If you are doing linear algebra, expecially with some kinds of physics, it is not uncommon that using ' (conjugate transpose) operator is mathematically correct. For example, you might have
W'*X*W
and if so then mathematically the conjugate transpose is typically the appropriate operator there.
Now, if you happen to be working with a system in which you are certain that none of the values can be complex-valued, then you can avoid the difficulty of seeing conj() by telling MATLAB that your symbolic variables are real-valued, such as
syms theta real
I recommend that you routinely tell MATLAB that symbolc variables are real-valued if you know that to be true: when MATLAB can reason that a value is surely real-valued then it will remove the conj()
##### 댓글 수: 3표시숨기기 이전 댓글 수: 2
Bathala Teja 2021년 9월 8일
"syms theta real" worked.
Thank you very much

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

R2021a

### Community Treasure Hunt

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

Start Hunting!

Translated by