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: get_sweep.m
    path of file: ./repos/AI-mag/src/utils
    
    the code of the file until where you have to start completion: function [n_sol, var] = get_sweep(sweep)
% Generate samples combinations (deterministic or random).
%
%    Different sample generation methods are available:
%        - Generates samples by combining vectors with only the provided combinations (deterministic or random)
%     
    
function [n_sol, var] = get_specified(var, n_sol_max)
% Generates generating all the specified combinations with the vectors.
%
%    The maximum number of samples can be controlled to:
%        - Avoid to long simulations
%        - Avoid memory saturation
%
%    Parameters:
%        var (struct): struct of vectors with the variables
%        n_sol_max (int): maximum number of samples to be of generated
%
%    Returns:
%        n_sol (int): number of generated samples
%        var (struct): struct of vectors with the combined variables

% get all the vector sizes
field = fieldnames(var);
for i=1:length(field)
    vec = var.(field{i});
    n_sol_vec(i) = length(vec);
end