Simbolic Toolbox: how to avoid conj() in matrix *

52 次查看(过去 30 天)
N=10;x=0:(N-1);
syms real r;
a=r.^(x),
b=r.^(-x),
M=b'*a
Result is
a =
[ 1, r, r^2, r^3, r^4, r^5, r^6, r^7, r^8, r^9]
b =
[ 1, 1/r, 1/r^2, 1/r^3, 1/r^4, 1/r^5, 1/r^6, 1/r^7, 1/r^8, 1/r^9]
M =
[ 1, r, r^2, r^3, r^4, r^5, r^6, r^7, r^8, r^9]
[ 1/conj(r), r/conj(r), r^2/conj(r), r^3/conj(r), r^4/conj(r), r^5/conj(r), r^6/conj(r), r^7/conj(r), r^8/conj(r), r^9/conj(r)]
[ 1/conj(r)^2, r/conj(r)^2, r^2/conj(r)^2, r^3/conj(r)^2, r^4/conj(r)^2, r^5/conj(r)^2, r^6/conj(r)^2, r^7/conj(r)^2, r^8/conj(r)^2, r^9/conj(r)^2]
[ 1/conj(r)^3, r/conj(r)^3, r^2/conj(r)^3, r^3/conj(r)^3, r^4/conj(r)^3, r^5/conj(r)^3, r^6/conj(r)^3, r^7/conj(r)^3, r^8/conj(r)^3, r^9/conj(r)^3]
[ 1/conj(r)^4, r/conj(r)^4, r^2/conj(r)^4, r^3/conj(r)^4, r^4/conj(r)^4, r^5/conj(r)^4, r^6/conj(r)^4, r^7/conj(r)^4, r^8/conj(r)^4, r^9/conj(r)^4]
[ 1/conj(r)^5, r/conj(r)^5, r^2/conj(r)^5, r^3/conj(r)^5, r^4/conj(r)^5, r^5/conj(r)^5, r^6/conj(r)^5, r^7/conj(r)^5, r^8/conj(r)^5, r^9/conj(r)^5]
[ 1/conj(r)^6, r/conj(r)^6, r^2/conj(r)^6, r^3/conj(r)^6, r^4/conj(r)^6, r^5/conj(r)^6, r^6/conj(r)^6, r^7/conj(r)^6, r^8/conj(r)^6, r^9/conj(r)^6]
[ 1/conj(r)^7, r/conj(r)^7, r^2/conj(r)^7, r^3/conj(r)^7, r^4/conj(r)^7, r^5/conj(r)^7, r^6/conj(r)^7, r^7/conj(r)^7, r^8/conj(r)^7, r^9/conj(r)^7]
[ 1/conj(r)^8, r/conj(r)^8, r^2/conj(r)^8, r^3/conj(r)^8, r^4/conj(r)^8, r^5/conj(r)^8, r^6/conj(r)^8, r^7/conj(r)^8, r^8/conj(r)^8, r^9/conj(r)^8]
[ 1/conj(r)^9, r/conj(r)^9, r^2/conj(r)^9, r^3/conj(r)^9, r^4/conj(r)^9, r^5/conj(r)^9, r^6/conj(r)^9, r^7/conj(r)^9, r^8/conj(r)^9, r^9/conj(r)^9]

采纳的回答

Andrei Bobrov
Andrei Bobrov 2011-12-28
try use
syms r real
...
M=b.'*a
  8 个评论
Yildirim Dirik
Yildirim Dirik 2019-5-16
Many thanks for your help. For below case, how can I define the every variable as real in the variable vecor 'a' ?
a = sym('a',[1,12])';

请先登录,再进行评论。

更多回答(1 个)

moh ab
moh ab 2019-6-26
hi my friends
i have problem in result of equetion .
in my code
syms te1 te2 ted1 ted2
q=[cos(te1+te2) -sin(te1+te2) 0;...
sin(te1+te2) cos(te1+te2) 0;...
0 0 1]
q1 =
[ -sin(te1 + te2), -cos(te1 + te2), 0]
[ cos(te1 + te2), -sin(te1 + te2), 0]
[ 0, 0, 0]
q2 =
[ -ted2*sin(te1 + te2), -ted2*cos(te1 + te2), 0]
[ ted2*cos(te1 + te2), -ted2*sin(te1 + te2), 0]
[ 0, 0, 0]
t=q1+q2
z=t*.q'
the z(1,1)=0
but in result of matlab show
sin(te1 + te2)*(ted1*cos(te1 + te2) + ted2*cos(te1 + te2)) - cos(te1 + te2)*(ted1*sin(te1 + te2) + ted2*sin(te1 + te2))
how can i fix it ?

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by