You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: plotCoordination.m
    path of file: ./repos/Cooperative-Control/General/Plotting
    
    the code of the file until where you have to start completion: function plotCoordination(V1,V2,V3,V4)
%% Plots coordination states of up to 4 vehicles vs. time
% takes gamma_plot veriable for each and outputs the relevant figure

%% Setup
% Figure properties
figure('Name','Coordination States');
hold on;
grid on;

% Number of samples to take
num = length(V1.time);


%% Plotting
% Vehicle 1
plot(V1.time, V1.gamma_plot(1:num), 'DisplayName', V1.vehicleType);


    
function plotCoordination(V1,V2,V3,V4)
%% Plots coordination states of up to 4 vehicles vs. time
% takes gamma_plot veriable for each and outputs the relevant figure

%% Setup
% Figure properties
figure('Name','Coordination States');
hold on;
grid on;

% Number of samples to take
num = length(V1.time);


%% Plotting
% Vehicle 1
plot(V1.time, V1.gamma_plot(1:num), 'DisplayName', V1.vehicleType);

% Vehicle 2
if nargin >= 2
    plot(V1.time, V2.gamma_plot(1:num), 'DisplayName', V2.vehicleType);
end