-
Notifications
You must be signed in to change notification settings - Fork 0
/
filename.m
executable file
·28 lines (26 loc) · 1.07 KB
/
filename.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Janez Presern, Ales Skorjanc, Tomaz Rodic, Jan Benda 2011-2015
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Function allows loading/saving .mat & .other files independent of the
% OS
% It checks inputDir variable for the (back)slashes concatenetes the
% components of path into correct form, using either slashes or
% backslashes.
% inputDir .. starting directory as red by parent function
% path .. vector of strings with all the components of the file path,
% including inputDir, Project, Results in the correct order
% as they should be: [inputDir,Project,Project]
% fileName .. name of the file we wish to load/save
function fn = filename (inputDir,path,fName)
fn= [];
if strfind(inputDir,'\');
for i = 1:length(path)
fn = [fn,path{i},'\'];
end;
fn = [fn,fName];
else
for i = 1:length(path)
fn = [fn,path{i},'/'];
end;
fn = [fn,fName];
end;