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