如题
想把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