-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_input.m
33 lines (30 loc) · 872 Bytes
/
read_input.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
function [x0,y0,z0,Umag0,theta,phi,omgX,omgY,omgZ] = read_input(filename,kick_id)
% Extracts the initial conditions for a given soccer kick from a file
% To call, use read_input('filename', kick_id), where kick_id is between 1
% and 7
param = importdata(filename,'\t',5);
if any(param.data(:,1) == kick_id)
row = find(param.data(:,1) == kick_id);
x0 = param.data(row,2);
y0 = param.data(row,3);
z0 = param.data(row,4);
Umag0 = param.data(row,5);
theta = param.data(row,6);
phi = param.data(row,7);
omgX = param.data(row,8);
omgY = param.data(row,9);
omgZ = param.data(row,10);
else
row = Nan;
x0 = Nan;
y0 = Nan;
z0 = Nan;
Umag0 = Nan;
theta = Nan;
phi = Nan;
omgX = Nan;
omgY = Nan;
omgZ = Nan;
disp('Warning: kick_id not found in read_input');
end
end