From 27f62761c380975d2720794ad6e3f55f7684db7f Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 24 Sep 2016 16:00:49 +0100 Subject: [PATCH] bug fix. strfind() behaviour changed between 2015a and 2015b --- ddToolbox/addSubFoldersToPath.m | 3 ++- ddToolbox/ddAnalysisSetUp.m | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ddToolbox/addSubFoldersToPath.m b/ddToolbox/addSubFoldersToPath.m index 458e4f6e..83e7ca04 100644 --- a/ddToolbox/addSubFoldersToPath.m +++ b/ddToolbox/addSubFoldersToPath.m @@ -27,5 +27,6 @@ function addSubFoldersToPath() end function matchFound = isStringMatch(str,pattern) -matchFound = any(~cellfun('isempty',strfind(str,pattern))); +matchFound = any(~cellfun('isempty',strfind(str,char(pattern)))); +% 2015a throws error without pattern being a char (ie need char(pattern)). end diff --git a/ddToolbox/ddAnalysisSetUp.m b/ddToolbox/ddAnalysisSetUp.m index 32e43801..2f12504f 100644 --- a/ddToolbox/ddAnalysisSetUp.m +++ b/ddToolbox/ddAnalysisSetUp.m @@ -9,11 +9,7 @@ function ddAnalysisSetUp() cd(toolboxPath) % Add subdirectories to Matlab path -try - addSubFoldersToPath() -catch - error('Some error in adding toolbox subpaths') -end +addSubFoldersToPath() % Ensure dependencies are installed and up-to-date. dependencies={...