%% Specify Axes for Compass Plot
% Starting in R2019b, you can display a tiling of plots using the tiledlayout and nexttile functions. Call the tiledlayout function to create a 1-by-2 tiled chart layout. Call the nexttile function to create an axes object and return the object as ax1. Create the left plot by passing ax1 to the compass function. Add a title to the plot by passing the axes to the title function. Repeat the process to create the right plot.

u = [7 5 -2 -5 8];
tiledlayout(1,2)

% Left plot
ax1 = nexttile;
v1 = [3 7 5 -4 -6];
compass(ax1,u,v1)
title(ax1,'Left Plot')

% Right plot
ax2 = nexttile;
v2 = [-3 -4 -5 6 6];
compass(ax2,u,v2)
title(ax2,'Right Plot')

% Copyright 2020 The MathWorks, Inc.