Skip to main content

checkInitialGuess.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function runs the continuous function to allow users to check that
% the optimization has been setup correctly. Additionally, the user's
% initial guesses are plotted to allow the user to visualize their initial
% guess.
%
% (struct, struct, function handle) -> ()
% Checks to that continuous function works and plots initial guess


function checkInitialGuess(guess, inputs, continuousFunction)
initialGuess = guess;
initialGuess.auxdata = inputs;
if isfield(initialGuess,'parameter')
initialGuess.phase.parameter = initialGuess.parameter;
end
output = continuousFunction(initialGuess);
output.solution = initialGuess;
end