![]() |
【求助】matlab字符的运用
我毕业设计做一个多脉冲滑移制导律,需要建立一个含十个未知数的表达式,再进行优化,但是我不知道matlab怎么把下面的t=sym('[t0 t1 t2 t3 t4 t5 t6 t7 t8 t9]');给最后表达出来!各位高手,帮帮忙,看一下!谢谢!给个意见
clear all; %先给出起始位置(x0, y0, z0)和终止位置(x1, y1, z1) x0=sym('[1000 0 0]'); x1=sym('[100 0 0]'); syms p vector_cos ptd p0d a T t tm; p=sqrt((x1-x0)*(x1-x0)'); %方向余弦向量为,vector_cos(1), vector_cos(2), vector_cos(3) vector_cos=(x0- x1)./p; %输入参数值 ptd=-1; p0d=-3; a=(p0d-ptd)/p; T=log2(ptd/p0d)/a; t=sym('[t0 t1 t2 t3 t4 t5 t6 t7 t8 t9]'); %定义数组 pm=sym('zeros(11,1)'); rm=sym('zeros(11,3)'); vmq=sym('zeros(10,3)'); Vmh=sym('zeros(10,3)'); tm=0; %计算m时刻的失径 for i=1:11 if i<2 pm(i)=p; else tm=tm+t(i-1); pm(i)=rho(tm); end end for i=1:11 rm(i,:)=x1+pm(i)*vector_cos; end SigmaV=sym('[0 0 0]'); %计算m时刻的速度差 for i=1:10 Vmq(i,:)=inv(Frr(t(i)))*(rm(i+1,:)'-Frv(t(i))*(rm(i,:)')); if i<2 Vmh(i,:)=p0d*vector_cos; else Vmh(i,:)=Fvr(t(i))*rm(i,:)'+Fvv(t(i))*Vmq(i,:)'; end end %计算总的速度差 for i=1:10 SigmaV=SigmaV+Vmq(i,:)-Vmh(i,:) end |
所有时间均为北京时间。现在的时间是 11:20。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.