[问题]dsolve初始值 循环

楼主: midfing (蛙特惹法克)   2016-03-15 17:35:35
如题
想把ODE的初始值带入循环
i=1;
while i<2
eqn = 'D2x+3*Dx+2*x = dirac(t-3)';
inits = 'x(0)=i,Dx(0)=0'
x=solve(eqn,inits,'t')
i=i=0.5;
end
有试着照版上类似的问题将第4行改成
eval(['inits=''x(0)=',num2str(i),'Dx(0)=0'])
但还是出现
error:A MATLAB string constant is not terminated properly
作者: JamesChen (James)   2016-03-16 10:27:00
你至少附上 error code 吧

Links booklink

Contact Us: admin [ a t ] ucptt.com