-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_cursor_stats.m
24 lines (23 loc) · 985 Bytes
/
data_cursor_stats.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
function output_txt = data_cursor_stats(obj,event_obj)
currAxes = get(get(event_obj, 'Target'), 'Parent');
dataStats = getappdata(currAxes, 'dataStats');
pos = get(event_obj, 'Position');
xIndex = find(dataStats.x == pos(1));
yIndex = find(dataStats.y == pos(2));
zIndex = find(dataStats.z == pos(3));
corrIndex = intersect(intersect(xIndex, yIndex), zIndex);
numExt = length(fieldnames(dataStats)) - 5;
extraTips = cell(1,numExt);
for k = 1:numExt
extension = ['ext', num2str(k)];
currField = dataStats.(extension);
extraTips{k} = [[extension ': '], num2str(currField{corrIndex})]
end
output_txt = [{
['FileName: ', dataStats.fileName{corrIndex}],...
['SPKC: ', dataStats.SPKC{corrIndex}],...
['X: ',num2str(pos(1),4)], ...
['Y: ',num2str(pos(2),4)], ...
['Z: ',num2str(pos(3),4)]
}, extraTips];
end