作者midfing (蛙特惹法克)
看板MATLAB
标题[问题]dsolve初始值 回圈
时间Tue Mar 15 17:35:35 2016
如题
想把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
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 120.107.167.151
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1458034541.A.E71.htm
l
推 JamesChen: 你至少附上 error code 吧 03/16 10:27
不好意思 已附上
※ 编辑: midfing (120.107.167.151), 03/23/2016 19:43:19