From 21606de82426c61ec345a26f1e0050e958573388 Mon Sep 17 00:00:00 2001 From: Alan Race Date: Tue, 9 Apr 2019 11:36:57 +0100 Subject: [PATCH] Fixed ability to find subclasses in the deployed version in MATLAB 2019a --- .gitignore | 4 ++++ src/SpectralAnalysis.m | 7 ++++--- src/util/getSubclasses.m | 8 ++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d0c7436..591288f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ src/processing/postprocessing/tSNE/ us.stackdump Ontologies/ + +mccExcludedFiles\.log + +*.exe diff --git a/src/SpectralAnalysis.m b/src/SpectralAnalysis.m index bab5d59..6ea70a1 100644 --- a/src/SpectralAnalysis.m +++ b/src/SpectralAnalysis.m @@ -5,13 +5,14 @@ if(isdeployed()) disp('Initialising MATLAB, please wait...'); path = ctfroot(); + disp(path); else path = [fileparts(mfilename('fullpath'))]; + + % Ensure all folders are on the path + addpath(genpath(path)); end -% Ensure all folders are on the path -addpath(genpath(path)); - % Ensure libraries are on the path addJARsToClassPath(); diff --git a/src/util/getSubclasses.m b/src/util/getSubclasses.m index 4b3a11d..a447934 100644 --- a/src/util/getSubclasses.m +++ b/src/util/getSubclasses.m @@ -2,9 +2,17 @@ % Get the location of the m file to instigate the search for subclasses if(isdeployed()) spectralAnalysisPath = [ctfroot() filesep 'src' filesep]; + + if(~exist(spectralAnalysisPath, 'file')) + spectralAnalysisPath = [ctfroot() filesep 'SpectralAnal' filesep 'src' filesep]; + end else spectralAnalysisPath = [fileparts(mfilename('fullpath')) filesep '..' filesep]; end + + if(~exist(spectralAnalysisPath, 'file')) + disp(['Couldn''t find the SpectralAnalysis path: ' spectralAnalysisPath]); + end % Limit the locations to speed up the search when looking for specific % types