-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport_ID_results.m
44 lines (36 loc) · 2.98 KB
/
import_ID_results.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function MOMENTS_Table = import_ID_results(filename, dataLines)
%IMPORTFILE Import data from a text file
% IDRESULTSPARTICIPANT10590DEGREECUT06COPY = IMPORTFILE(FILENAME) reads
% data from text file FILENAME for the default selection. Returns the
% data as a table.
%
% IDRESULTSPARTICIPANT10590DEGREECUT06COPY = IMPORTFILE(FILE,
% DATALINES) reads data for the specified row interval(s) of text file
% FILENAME. Specify DATALINES as a positive scalar integer or a N-by-2
% array of positive scalar integers for dis-contiguous row intervals.
%
% Example:
% IDRESULTSParticipant10590degreecut06Copy = importfile("C:\Users\adpatrick\OneDrive - nih.no\Desktop\Calgary\Test2\ID_RESULTS_Participant_105_90degreecut06 - Copy.sto", [8, Inf]);
%
% See also READTABLE.
%
% Auto-generated by MATLAB on 29-Sep-2023 13:58:01
%% Input handling
% If dataLines is not specified, define defaults
if nargin < 2
dataLines = [8, Inf];
end
%% Set up the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 46);
% Specify range and delimiter
opts.DataLines = dataLines;
opts.Delimiter = "\t";
% Specify column names and types
opts.VariableNames = ["time", "pelvis_tilt_y_moment", "pelvis_list_x_moment", "pelvis_rotation_z_moment", "pelvis_tx_force", "pelvis_ty_force", "pelvis_tz_force", "hip_flexion_y_r_moment", "hip_adduction_x_r_moment", "hip_rotation_z_r_moment", "hip_flexion_y_l_moment", "hip_adduction_x_l_moment", "hip_rotation_z_l_moment", "lumbar_extension_y_moment", "lumbar_bending_x_moment", "lumbar_rotation_z_moment", "knee_flexion_y_r_moment", "knee_rotation_z_r_moment", "knee_adduction_x_r_moment", "knee_flexion_y_l_moment", "knee_rotation_z_l_moment", "knee_adduction_x_l_moment", "arm_flexion_y_r_moment", "arm_adduction_x_r_moment", "arm_rotation_z_r_moment", "arm_flexion_y_l_moment", "arm_adduction_x_l_moment", "arm_rotation_z_l_moment", "ankle_flexion_y_r_moment", "ankle_rotation_z_r_moment", "ankle_eversion_x_r_moment", "ankle_flexion_y_l_moment", "ankle_rotation_z_l_moment", "ankle_eversion_x_l_moment", "elbow_flexion_y_r_moment", "elbow_flexion_y_l_moment", "subtalar_angle_r_force", "subtalar_angle_l_force", "hand_pronation_x_r_moment", "hand_pronation_x_l_moment", "mpj_flexion_y_r_moment", "mpj_flexion_y_l_moment", "wrist_flexion_y_r_moment", "wrist_rotation_z_r_moment", "wrist_flexion_y_l_moment", "wrist_rotation_z_l_moment"];
opts.VariableTypes = ["double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double"];
% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";
% Import the data
MOMENTS_Table = readtable(filename, opts);
end