image thumbnail
from Multiple simulations in 2-D by Zhi Han
Simulating a 2-D system for multiple initial points

plotstates(x, tout)
function plotstates(x, tout)
xp = x(:,1:2:end);
xp = [xp, xp(:,1)];
yp = x(:,2:2:end);
yp = [yp, yp(:,1)];
zp = tout;
zp = repmat(zp,1,size(yp,2));

s = surf(xp,yp,zp);
light;
set(s, 'EdgeColor','none', 'FaceColor','r');

set(s, 'FaceLighting','phong');

axis square;
box on;

xlabel('x');
ylabel('y');
zlabel('t');

Contact us at files@mathworks.com