This is a static copy of a profile report

Home

toolboxdir (Calls: 4, Time: 0.002 s)
Generated 18-May-2021 16:05:20 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/general/toolboxdir.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...ton.AxesToolbarButton>makeIconPathclass method4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
39
s = fullfile(tbxprefix, tbxdir...
40.001 s40.0%
20
validateattributes(tbxdirname,...
40.000 s10.6%
40
if isfolder(s)
40.000 s10.4%
22
tbxdirname = char(tbxdirname);
40.000 s6.9%
41
return
40.000 s6.1%
All other lines  0.001 s26.0%
Totals  0.002 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
fullfilefunction40.001 s24.5%
Self time (built-ins, overhead, etc.)  0.002 s75.5%
Totals  0.002 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function54
Non-code lines (comments, blank lines)29
Code lines (lines that can run)25
Code lines that did run8
Code lines that did not run17
Coverage (did run/can run)32.00 %
Function listing
time 
Calls 
 line
   1 
function s = toolboxdir(tbxdirname)
   2 
% TOOLBOXDIR Root folder for specified toolbox
   3 
%    S = TOOLBOXDIR(TBXDIRNAME) returns a character vector that is the
   4 
%    absolute path to the specified toolbox folder name, TBXDIRNAME
   5 
%
   6 
%    TOOLBOXDIR is particularly useful for MATLAB Compiler. The base
   7 
%    folder of all toolboxes installed with MATLAB is
   8 
%    <matlabroot>/toolbox/<tbxdirname>. However, in deployed mode, the base
   9 
%    folders of the toolboxes are different. TOOLBOXDIR returns the
  10 
%    correct root folder irrespective of the mode in which the code is
  11 
%    running. Note that TOOLBOXDIR lowercases any input path that matches
  12 
%    a path in the MCR modulo case. It preserves the case of input paths
  13 
%    that do not - i.e. those that lie in the CTF.
  14 
%
  15 
%    See also MATLABROOT, COMPILER/CTFROOT.
  16 

  17 
%    Copyright 1984-2020 The MathWorks, Inc.
  18 

< 0.001 
      4 
  19
narginchk(1,1) 
< 0.001 
      4 
  20
validateattributes(tbxdirname,{'char','string'},{'scalartext'}, ... 
  21 
    'toolboxdir','',1)
< 0.001 
      4 
  22
tbxdirname = char(tbxdirname); 
  23 

< 0.001 
      4 
  24
if isdeployed 
  25 
    % In deployed mode, lower cases tbx name if it is in MCR.
  26 
    % Check if the tbx directory exists in MCR first.
  27 
    s = fullfile(tbxprefix, lower(tbxdirname));
  28 
    if isfolder(s)
  29 
        return
  30 
    end
  31 
    
  32 
    % In deployed mode, don't lower case tbx name if it is in CTF.
  33 
    s = fullfile(ctfroot, 'toolbox', tbxdirname);
  34 
    if isfolder(s)
  35 
        return
  36 
    end
< 0.001 
      4 
  37
else 
  38 
    % In desktop mode, case is not changed.
< 0.001 
      4 
  39
    s = fullfile(tbxprefix, tbxdirname); 
< 0.001 
      4 
  40
    if isfolder(s) 
< 0.001 
      4 
  41
        return 
  42 
    end
  43 
end
  44 

  45 
% The tbx directory does not exist, if it reaches here. Check if it has
  46 
% been renamed or is just unknown.
  47 
newname = checkRenamedToolboxFolders(tbxdirname);
  48 
if ~isequal(newname, tbxdirname)
  49 
    warning(message('MATLAB:toolboxdir:ProductNameDeprecated', tbxdirname, newname));
  50 
    s = toolboxdir(newname);
  51 
    return;
  52 
end
  53 

  54 
error(message('MATLAB:toolboxdir:DirectoryNotFound', tbxdirname))

Other subfunctions in this file are not included in this listing.