-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathgetSurfaceData.m
More file actions
45 lines (44 loc) · 1.36 KB
/
getSurfaceData.m
File metadata and controls
45 lines (44 loc) · 1.36 KB
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
45
function data = getSurfaceData( userdata, datatype )
% GETSURFACEDATA Returns surface mapping data from userdata
%
% Usage:
% data = getSurfaceData( userdata, datatype )
% Where:
% userdata - see importcarto_mem
% datatype - the required data. Must be one of:
% 'act', 'bip', 'uni', 'imp', 'frc'
% data - The returned surface mapping data
%
% GETSURFACEDATA Returns surface mapping data from userdata. Data type is
% specified by the `datatype` argument:
% `act` - activation time
% `bip` - bipolar voltage
% `uni` - unipolar voltage
% `imp` - impedance
% `frc` - contact force
%
% Author: Steven Williams (2020) (Copyright)
% SPDX-License-Identifier: Apache-2.0
%
% Modifications -
%
% Info on Code Testing:
% ---------------------------------------------------------------
% data = getSurfaceData(userdata, 'bip');
% ---------------------------------------------------------------
%
% ---------------------------------------------------------------
% code
% ---------------------------------------------------------------
switch datatype
case 'act'
data = userdata.surface.act_bip(:,1);
case 'bip'
data = userdata.surface.act_bip(:,2);
case 'uni'
data = userdata.surface.uni_imp_frc(:,1);
case 'imp'
data = userdata.surface.uni_imp_frc(:,2);
case 'frc'
data = userdata.surface.uni_imp_frc(:,3);
end