Skip to main content

numberArrayToArrayDouble.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function iterates through the given MATLAB Array of type double
% and adds each item to a new ArrayDouble OpenSim/Simbody object and
% returns the ArrayDouble.
%
% (Array of double) -> (ArrayDouble)
% Rearranges MATLAB double array into an ArrayDouble


function arrayDouble = numberArrayToArrayDouble(numberArray)
import org.opensim.modeling.ArrayDouble
arrayDouble = ArrayDouble();
arrayDouble.setSize(length(numberArray));
for i=1:length(numberArray)
arrayDouble.set(i-1, numberArray(i));
end
end