[其他] for 迴圏問題
一直無法解決回圈只跑出1組值的問題 50
應該會有50*3 個值
請教大家
感謝大家解惑!!^^
function T=checkpoincarevarycccfinal
s=0.005;
e=0.25;
time=[];
ptt=[];
for j=1:3
c=0.18+0.02*(j-1);
x=[1e-6,1e-6,1e-6,1-1e-6];
[t, y]=ode45(@diflv4dhet,[0 8888],x,[],c,s,e);
for i=2:length(t)
if y(i-1,3) >0.1 && y(i,3) <0.1
w =t(i)+((0.1-y(i,3))*(t(i+1)-t(i))/(y(i+1,3)-y(i,3))) ;
%time temp
time=[time w];
end
end
T=time(2:end-1)-time(1:end-2) ;
T=T(end-49 : end);
end
point=[c*ones(1,50);T];
ptt=[ptt point];
end
----------------------------------------
function dydt=diflv4dhet(t,y,c,s,e)
dydt =[ y(1)*(1-(y(1)+y(2)+y(3)+y(4))-c*y(2)-s*y(3)+e*y(4));
y(2)*(1-(y(1)+y(2)+y(3)+y(4))-c*y(3)-s*y(4)+e*y(1));
y(3)*(1-(y(1)+y(2)+y(3)+y(4))-c*y(4)-s*y(1)+e*y(2));
y(4)*(1-(y(1)+y(2)+y(3)+y(4))-c*y(1)-s*y(2)+e*y(3))
];
end
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 120.107.198.122
→
04/13 22:58, , 1F
04/13 22:58, 1F
→
04/13 23:20, , 2F
04/13 23:20, 2F
討論串 (同標題文章)
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章