Commit 74ff54f2 authored by jayd1860's avatar jayd1860
Browse files

v1.16.2

-- Fix matlab error because isfile() and isdir() don't exist in earlier versions of matlab. Made these functions backwards compatible by adding a isdir_private() and isfile_private() wrappers.
parent 61f11f04
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ function pathname = filesepStandard(pathname0)
%

pathname = [];
if ~isdir(pathname0) && ~isfile(pathname0)    
if ~isdir_private(pathname0) && ~isfile_private(pathname0)    
    return
end
if ~ischar(pathname0)
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

vrnnum{1} = '1';   % Major version #
vrnnum{2} = '16';  % Major sub-version #
vrnnum{3} = '1';   % Minor version #
vrnnum{3} = '2';   % Minor version #
vrnnum{4} = '0';   % Minor sub-version # or patch #: 'p1', 'p2', etc

Utils/isdir_private.m

0 → 100644
+15 −0
Original line number Diff line number Diff line
function b = isdir_private(dirname)
%
% isdir_private() is a backward compatible version of matlab's isdir()
% function.
%
% isdir() is a new matlab function that is an improvment over exist() to 
% tell if a pathname is a directory or not. But it didn't exist prior to R2017. 
% Therefore we use try/catch to still be able to use isdir when it exists

try
    b = isdir(dirname);
catch
    b = (exist(dirname,'dir') == 7);
end

Utils/isfile_private.m

0 → 100644
+15 −0
Original line number Diff line number Diff line
function b = isfile_private(dirname)
%
% isfile_private() is a backward compatible version of matlab's isfile()
% function.
%
% isfile() is a new matlab function that is an improvment over exist() to 
% tell if a pathname is a file or not. But it didn't exist prior to R2017. 
% Therefore we use try/catch to still be able to use isfile when it exists

try
    b = isfile(dirname);
catch
    b = (exist(dirname,'file') == 2);
end