Check whether Matlab has 'ToolName' toolbox mode = 0; % 'ToolName' toolbox is not installed mode = 1; % 'ToolName' toolbox is installed Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function mode = vb_tool_check(ToolName) 0002 % Check whether Matlab has 'ToolName' toolbox 0003 % mode = 0; % 'ToolName' toolbox is not installed 0004 % mode = 1; % 'ToolName' toolbox is installed 0005 % 0006 % Copyright (C) 2011, ATR All Rights Reserved. 0007 % License : New BSD License(see VBMEG_LICENSE.txt) 0008 0009 %ToolName = 'Optimization'; 0010 %ToolName = 'Compiler'; 0011 0012 MATver = ver; 0013 0014 Ntool = length(MATver); 0015 Mtool = []; 0016 0017 for n=1:Ntool 0018 Mtool = [Mtool MATver(n).Name]; 0019 end 0020 0021 if isempty(strfind(Mtool,ToolName)) 0022 mode = 0; % 'ToolName' toolbox is not installed 0023 else 0024 mode = 1; % 'ToolName' toolbox is installed 0025 end