作者greethux (招呼襪)
看板MATLAB
標題[討論] 微分方程相關
時間Fri Nov 30 17:43:21 2018
想解xsin(x)+ycos(x)跟xsin(x)-ycos(x)
但不知為何以及哪裡錯
主程式
x0 = [0 1];
tsp = [0 2];
[x1,x2] = ode45('tseat',tsp,x0);
副程式
function dx = tseat(x1,x2)
dx = zeros(2,1);
dx(1) = x(1)*sin(x)+x(2)*cos(x);
dx(2) = x(1)*sin(x)-x(2)*cos(x);
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.198.183.28
※ 文章網址: https://webptt.com/m.aspx?n=bbs/MATLAB/M.1543571007.A.654.html
※ 編輯: greethux (114.198.183.28), 11/30/2018 21:14:41
1F:→ book5601: 副程式的X(1)跟X(2)沒有定義啊… 12/01 01:04