-
Notifications
You must be signed in to change notification settings - Fork 0
/
FirstSongAnalysisFile.m
48 lines (40 loc) · 1.77 KB
/
FirstSongAnalysisFile.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
function [] = FirstSongAnalysisFile()
%% Select Bird and Get Pre date names
%-------------------------------------------------------------------------%
% Change directory to folder that contains folders of raw bird song data
%-------------------------------------------------------------------------%
rawSongsDir = 'C:\Users\Dr. JT\Documents\DataAnalysis\TF_Birdsong\SAP_Data';
cd(rawSongsDir);
dsDir = 'C:\Users\Dr. JT\Documents\DataAnalysis\TF_Birdsong\DataSet_Data\';
%-------------------------------------------------------------------------%
% User input selected bird number
%-------------------------------------------------------------------------%
birdsdir = cellstr(ls);
birdnums = birdsdir(3:end);
birdSel = listdlg('ListString', birdnums,...
'SelectionMode', 'single',...
'ListSize', [95 125],...
'PromptString', 'Select a bird');
birdNum = birdnums{birdSel};
dateFold = strcat(rawSongsDir,'\',birdNum,'\Pre\');
cd(dateFold);
datedir = cellstr(ls);
File_Predates = datedir(3:end);
%-------------------------------------------------------------------------%
% User input selected experimental condition
%-------------------------------------------------------------------------%
birdDsDir = strcat(dsDir,birdNum);
for si = 1:length(File_Predates)
cd(dateFold)
[~, ~, songxlsfile] = xlsread(File_Predates{si},'Sheet1');
[songDataset] = CreateSongdataSet(songxlsfile);
cd(birdDsDir)
songPieces = strsplit(File_Predates{si},'_');
dateParts = strsplit(songPieces{2},'.');
datePart = dateParts{1};
save(strcat(birdNum,'_Pre_',datePart,'.mat'),'songDataset');
end
%-------------------------------------------------------------------------%
% Get PREALL
%-------------------------------------------------------------------------%
Get_PreALLSAP_Dataset;