| Graphics | ![]() |
Three-Dimensional Quiver Plots
Three-dimensional quiver plots (quiver3) display vectors consisting of (u,v,w) components at (x,y,z) locations. For example, you can show the path of a projectile as a function of time,

First, assign values to the constants vz and a.
vz = 10; % Velocity a = -32; % Acceleration
Then, calculate the height z, as time varies from 0 to 1 in increments of 0.1.
t = 0:.1:1; z = vz*t + 1/2*a*t.^2;
Calculate the position in the x and y directions.
vx = 2; x = vx*t; vy = 3; y = vy*t;
Compute the components of the velocity vectors and display the vectors using the 3-D quiver plot.
u = gradient(x); v = gradient(y); w = gradient(z); scale = 0; quiver3(x,y,z,u,v,w,scale) axis square
| Two-Dimensional Quiver Plots | Contour Plots | ![]() |