Skip to main content

checkStateGuess.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function checks that the initial guess states file is in the correct
% order
%
% (struct) -> (struct)
%


function inputs = checkStateGuess(inputs)
if isfield(inputs.initialGuess, 'state')
for i = 1 : inputs.numCoordinates
for j = 1 : length(inputs.initialGuess.stateLabels)
if strcmpi(inputs.coordinateNames(i), inputs.initialGuess.stateLabels(j))
stateIndex(i) = j;
end
end
end
inputs.initialGuess.state = inputs.initialGuess.state(:, [stateIndex ...
stateIndex + inputs.numCoordinates stateIndex + inputs.numCoordinates * 2]);
end
end