konze
konze

Reputation: 893

Plot Trajectory in Matlab with quiver

I'm trying to plot a trajectory in Matlab with quiver. This is the code the Vectorfield.

[X,Y] = meshgrid(-2:0.5:2);

xfield = Y.^2
yfield = X.^2

figure
quiver(X,Y,xfield,yfield);

Now I'd like to plot a path through this field with y = x-1, however I cloudn't find any tutorial for this on the internet.

Upvotes: 0

Views: 929

Answers (1)

chappjc
chappjc

Reputation: 30579

Hold the axis and it's limits, then use plot:

hold on
axis manual
plot(xlim,xlim-1)

Upvotes: 2

Related Questions