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: getPropertyProfiles.m
    path of file: ./repos/PESTO
    
    the code of the file until where you have to start completion: function [properties,fh] = getPropertyProfiles(properties, parameters, objective_function, varargin)
% getPropertyProfiles.m calculates the profiles of user-supplied property
% functions, starting from the maximum a posteriori estimate. This
% calculation is done by varying the value of each property function
% respectively, starting from the value of this function at the global
% optimum and by reoptimizing the likelihood/posterior estimate in each 
% variational step of 
    
function gradient is not available
if isempty(options.profileOptimizationOptions)
    options.profileOptimizationOptions = options.localOptimizerOptions;
end
if ~strcmp(options.profileOptimizationOptions.GradObj, 'on')
    warning('For efficient and reliable optimization, getPropertyProfiles.m requires gradient information.')
end

%% Initialization and figure generation
fh = [];
switch options.mode
    case 'visual'
        if (isempty(options.fh) || ~isvalid(options.fh))
            fh = figure('Name','getPropertyProfiles');
        else
            fh = figure(options.fh);
        end