valueOrAlternate.m
% This function is part of the NMSM Pipeline, see file for full license.
%
% This function returns either the value of the field given or the
% alternative value provided as a third argument.
%
% (struct, string, Any) -> (Any)
function output = valueOrAlternate(inputStruct, fieldName, alternative)
if(isfield(inputStruct, fieldName))
output = inputStruct.(fieldName);
else
output = alternative;
end
end