Skip to main content

stringArrayToArrayStr.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function converts a MATLAB array of strings to an OpenSim ArrayStr
% object.
%
% (array of strings) -> (ArrayStr)
% converts array of strings to ArrayStr


function arrayStr = stringArrayToArrayStr(stringArray)
import org.opensim.modeling.ArrayStr
arrayStr = ArrayStr();
arrayStr.setSize(length(stringArray));
for i=1:length(stringArray)
arrayStr.set(i-1, stringArray(i));
end
end