-
Notifications
You must be signed in to change notification settings - Fork 4
/
processNew.m
51 lines (36 loc) · 893 Bytes
/
processNew.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
function processObj=processNew(varargin)
% define new processing object
% if a numeric value is entered, it will target the repository
path=pwd;
filename='myprocess';
id=1;
if nargin~=0
for i=1:numel(varargin)
if strcmp(varargin{i},'path')
path=varargin{i+1};
end
if strcmp(varargin{i},'filename')
filename=varargin{i+1};
end
if strcmp(varargin{i},'id')
id=varargin{i+1};
end
end
if numel(filename)==0
filename=['myprocess ' char(datetime)];
end
else
[filename,path,rep] = uiputfile('*.mat','File Selection',fullfile(path,[filename '.mat']));
if isequal(filename,0)
disp('User selected Cancel');
processObj=[];
return;
else
disp(['User selected ', fullfile(path, filename)]);
end
end
if numel(strfind(filename,'.mat'))
filename=replace(filename,'.mat','');
end
processObj=process(path,filename,id);
processObj.log('Classi creation','Creation')