Skip to main content

parseMtpStandard.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function pulls the files from the directory given as the input.
% These files are then organized into a 3D matrix with dimensions matching:
% (numFrames, numTrials, numMuscles)
%
% (Array of string) -> (3D matrix of number)
% returns a 3D matrix of the loaded data trials


function [cells, columnNames] = parseMtpStandard(files)
import org.opensim.modeling.Storage
file = Storage(files(1));
dataFromFileOne = storageToDoubleMatrix(file);
columnNames = getStorageColumnNames(file);
cells = zeros([length(files) ...
size(dataFromFileOne)]);
cells(1, :, :) = dataFromFileOne;
for i=2:length(files)
cells(i, :, :) = storageToDoubleMatrix(Storage(files(i)));
end
end