STAR-future's picture
LittleBoy SpaceData v1: licence-checked public space data
5ab75a9 verified
Raw History Blame Contribute Delete
778 Bytes
function reply = hasParallelToolbox(S)
% Get availability of the Parallel Processing Toolbox:
% R = hasParallelToolbox()
% Disable the flag for an existing PPT manually:
% hasParallelToolbox(false)
% Re-enable the actual status:
% hasParallelToolbox(true) % Considers a missing toolbox also
% Set Variables as persistent (reduced overhead)
persistent hasPPT usePPT
if isempty(hasPPT)
% Initialize variables
hasPPT = false;
usePPT = false;
% Get Version Information
VersionInfo = ver;
for i=1:length(VersionInfo)
if strcmpi(VersionInfo(i).Name,'Parallel Computing Toolbox')
hasPPT = true;
end
end
usePPT = hasPPT;
end
if nargin > 0
usePPT = (any(S)) && hasPPT;
end
reply = usePPT;
end