[問題]dsolve初始值 迴圈

看板MATLAB作者 (蛙特惹法克)時間8年前 (2016/03/15 17:35), 8年前編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
如題 想把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://www.ptt.cc/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
文章代碼(AID): #1MvzTjvn (MATLAB)