Hi, I would like to plot a 3D picture (t,x,y) using the following code\\
function my_phase()
IC = [0.1 0.1];\\
hold on for ii = 1:length(IC(:,1)) %vectorfield(@EOM,0:.05:2.5,0:0.05:1); [t,X] = ode45(@EOM,[0 150],IC(ii,:)); u = X(:,1); w = X(:,2); plot(u,w,'b', 'linewidth',3)
%plot(t,u, 'b', 'linewidth',3)
%plot(t,w, 'r', 'linewidth',3)
%legend('Prey', 'Predator')
end
fsize=15;
xlabel('Time','FontSize',fsize)
ylabel('Population size','FontSize',fsize)
grid
end
function dX = EOM(~, x) dX = zeros(2,1); u = x(1); w = x(2); k = 3;m = 3;c=1; dX = [u*(1-(u/k)-m*w/(1+u));... w*(-c+m*u/(1+u))]; end
Any help is appreciated.

댓글 수: 2

jonas
jonas 2018년 7월 23일
And what is the question?
Sama
Sama 2018년 7월 23일
I do not know how to plot the 3D picture for the model that is, (time, x,y) I have tried plot3(t,u,w) but it only gives me a 2-D plot !!!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2018년 7월 23일

댓글:

2018년 7월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by