-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get_First_PreDate.m
70 lines (51 loc) · 1.97 KB
/
Get_First_PreDate.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
function [birdNum, date] = Get_First_PreDate()
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
%-------------------------------------------------------------------------%
% Change directory to folder that contains folders of raw bird song data
%-------------------------------------------------------------------------%
rawSongsDir = 'C:\Users\Dr. JT\Documents\DataAnalysis\TF_Birdsong\RawSongs';
cd(rawSongsDir);
%-------------------------------------------------------------------------%
% 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};
%-------------------------------------------------------------------------%
% User input selected experimental condition
%-------------------------------------------------------------------------%
% possibleConds = {'Pre'};
%
expCondFold = strcat(rawSongsDir,'\',birdNum,'\');
cd(expCondFold);
%
% expCdir = cellstr(ls);
% exConds = expCdir(3:end);
%
% condSel = listdlg('ListString', possibleConds,...
% 'SelectionMode', 'single',...
% 'ListSize', [100 75],...
% 'PromptString', 'Select a condition');
%
% conselection = possibleConds{condSel};
%
% condOut = cellfun(@(x) strcmp(conselection,x), exConds);
experCond = 'Pre';
%-------------------------------------------------------------------------%
% User input selected date
%-------------------------------------------------------------------------%
dateFold = strcat(expCondFold,'\',experCond,'\');
cd(dateFold);
datedir = cellstr(ls);
dates = datedir(3:end);
% dateSel = listdlg('ListString', dates,...
% 'SelectionMode', 'single',...
% 'ListSize', [95 250],...
% 'PromptString', 'Select a date');
dateSelection = dates{1};
date = dateSelection(5:end);