-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOSort_path_setUP_css.m
More file actions
65 lines (41 loc) · 946 Bytes
/
OSort_path_setUP_css.m
File metadata and controls
65 lines (41 loc) · 946 Bytes
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
63
64
65
function [] = OSort_path_setUP_css(mainLOC)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
if nargin == 0
useLoc = uigetdir();
else
useLoc = mainLOC;
end
cd(useLoc)
% check for .ncs files
[ncCk , mesAge] = NSCcheck(useLoc);
if ~ncCk
disp(mesAge)
return
else
disp(mesAge)
end
dataFold = [useLoc , filesep , 'rawDemo'];
if ~exist(dataFold,'dir')
mkdir(dataFold)
nscDir = dir('*.ncs');
nscDirn = {nscDir.name};
for ni = 1:length(nscDirn)
olddir = [useLoc , filesep , nscDirn{ni}];
newdir = [dataFold , filesep , nscDirn{ni}];
movefile(olddir , newdir)
end
end
end
function [outChk , meSSage] = NSCcheck(inLOc)
cd(inLOc)
nscDir = dir('*.ncs');
nscDirn = {nscDir.name};
if isempty(nscDirn)
outChk = false;
meSSage = 'Folder does NOT contain NSC files';
else
outChk = true;
meSSage = 'Folder location set!';
end
end