%% Specify Axes for Quiver Plot
% Create a grid of X and Y values and two sets of U and V directional components.

[X,Y] = meshgrid(0:pi/8:pi,-pi:pi/8:pi);
U1 = sin(X);
V1 = cos(Y);
U2 = sin(Y);
V2 = cos(X); 

% Create a tiled layout of plots with two axes, ax1 and ax2. Add a quiver plot and title to each axes. (Before R2019b, use subplot instead of tiledlayout and nexttile.)

tiledlayout(1,2)

ax1 = nexttile;
quiver(ax1,X,Y,U1,V1)
axis equal
title(ax1,'Left Plot')

ax2 = nexttile;
quiver(ax2,X,Y,U2,V2)
axis equal
title(ax2,'Right Plot')

% Copyright 2020 The MathWorks, Inc.