-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHAWKProcessingTimeDataGather.m
62 lines (55 loc) · 3.24 KB
/
HAWKProcessingTimeDataGather.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
clear all;
close all;
% Get Folder where all the files are:
clear all
if (ispc) %if on PC workstation in MERL 223
DestinationFolder = 'C:\Users\HAWK\Documents\HAWKData';
addpath(genpath('C:\Users\HAWK\Documents\HAWKDataAnalysisCode\YAMLMatlab_0.4.3'));
excelFile = 'C:\Users\HAWK\Dropbox\HAWK\HAWKExperimentLog.xls';
addpath('C:\Users\HAWK\Documents\HAWKDataAnalysisCode\20130227_xlwrite');s
% For excel writing, need these files linked:
% Initialisation of POI Libs
% Add Java POI Libs to matlab javapath
javaaddpath('20130227_xlwrite\20130227_xlwrite\poi_library\poi-3.8-20120326.jar');
javaaddpath('20130227_xlwrite\20130227_xlwrite\poi_library\poi-ooxml-3.8-20120326.jar');
javaaddpath('20130227_xlwrite\20130227_xlwrite\poi_library\poi-ooxml-schemas-3.8-20120326.jar');
javaaddpath('20130227_xlwrite\20130227_xlwrite\poi_library\xmlbeans-2.3.0.jar');
javaaddpath('20130227_xlwrite\20130227_xlwrite\poi_library\dom4j-1.6.1.jar');
javaaddpath('20130227_xlwrite\20130227_xlwrite\poi_library\stax-api-1.0.1.jar');
elseif (ismac) % if on Eileen's personal computer
% DestinationFolder = '/Volumes/home/HAWK Data/Force Response Data/';
DestinationFolder = '/Volumes/Backup Disc Celegans/HAWKData/';
addpath(genpath('/Users/emazzochette/Documents/MicrosystemsResearch/HAWK/HAWKDataAnalysisCode/HAWKDataAnalysisCode/YAMLMatlab_0.4.3'));
% excelFile = '/Users/emazzochette/Box Sync/HAWK/HAWKExperimentLog.xls';
excelFile = '/Users/emazzochette/Documents/MicrosystemsResearch/HAWK/Experiments/Force Position Response Assay/DataDrop.xls';
addpath('/Users/emazzochette/Documents/MicrosystemsResearch/HAWK/HAWKDataAnalysisCode/HAWKDataAnalysisCode/20130227_xlwrite');
% For excel writing, need these files linked:
% Initialisation of POI Libs
% Add Java POI Libs to matlab javapath
javaaddpath('20130227_xlwrite/20130227_xlwrite/poi_library/poi-3.8-20120326.jar');
javaaddpath('20130227_xlwrite/20130227_xlwrite/poi_library/poi-ooxml-3.8-20120326.jar');
javaaddpath('20130227_xlwrite/20130227_xlwrite/poi_library/poi-ooxml-schemas-3.8-20120326.jar');
javaaddpath('20130227_xlwrite/20130227_xlwrite/poi_library/xmlbeans-2.3.0.jar');
javaaddpath('20130227_xlwrite/20130227_xlwrite/poi_library/dom4j-1.6.1.jar');
javaaddpath('20130227_xlwrite/20130227_xlwrite/poi_library/stax-api-1.0.1.jar');
end
%asks user for the directory where all the files are:
%directory = uigetdir(DestinationFolder,'Choose the folder where the data if located');
directories = uipickfiles( 'FilterSpec',DestinationFolder);
for dir = 1:length(directories)
%Select next directory:
directoryCell = directories(:,dir);
directory = directoryCell{1};
%determine experiment title based on file name:
experimentTitle = getExperimentTitle(directory);
mat_file = fullfile(directory,strcat(experimentTitle,'_tracking_parsedData.mat'));
try
load(mat_file);
trackingDataFields = fieldnames(TrackingData);
if(ismember('TimingData',trackingDataFields))
TimingData = getProcessingTimeData(TrackingData.TimingData);
filename = fullfile(directory,strcat(experimentTitle,'_ProcessingTimeData.mat'));
save(filename,'TimingData');
end
end
end