This is a static copy of a profile report

Home

makeStructure (Calls: 1, Time: 0.010 s)
Generated 18-May-2021 16:05:21 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/external/interfaces/json/+matlab/+internal/+json/makeStructure.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...p>HelpTopicMap.retrieveHelpTargetsclass method1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
45
data = cell2struct(values, nam...
10.010 s97.4%
41
if ~(areNamesUnique)
10.000 s1.1%
49
end
10.000 s0.0%
48
end
10 s0%
46
if isempty(data)
10 s0%
All other lines  0.000 s1.4%
Totals  0.010 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function49
Non-code lines (comments, blank lines)41
Code lines (lines that can run)8
Code lines that did run6
Code lines that did not run2
Coverage (did run/can run)75.00 %
Function listing
time 
Calls 
 line
   1 
function data = makeStructure(names, values, areNamesUnique)
   2 
% Create a structure from names and values cell arrays. Ensure the names
   3 
% are unique.
   4 
% Syntax
   5 
%
   6 
%     data = makeStructure(names, values, areNamesUnique)
   7 
%
   8 
% Description
   9 
%
  10 
%     data = makeStructure(names, values, areNamesUnique) creates a structure from names and values cell arrays 
  11 
%     
  12 
%
  13 
% Input Arguments
  14 
%
  15 
%     names          - cell array
  16 
%     values         - cell array 
  17 
%     areNamesUnique - logical (true/false)
  18 
%
  19 
% Output Arguments
  20 
%
  21 
%     data - output structure containing unique and valid field names
  22 
%
  23 
% Example
  24 
%
  25 
%     names = {'x_0', 'x'};
  26 
%     values = {'Hello', 24};
  27 
%     areNamesUnique = true;
  28 
%     matlab.internal.json.makeStructure(names, values, areNamesUnique)
  29 
%
  30 
% This function is internal and is subject to change in the future.
  31 

  32 
% Copyright 2015-2019 The MathWorks, Inc.
  33 
% CONFIDENTIAL AND CONTAINING PROPRIETARY TRADE SECRETS
  34 
% The source code contained in this listing contains proprietary and
  35 
% confidential trade secrets of The MathWorks, Inc.   The use, modification,
  36 
% or development of derivative work based on the code or ideas obtained
  37 
% from the code is prohibited without the express written permission of The
  38 
% MathWorks, Inc.  The disclosure of this code to any party not authorized
  39 
% by The MathWorks, Inc. is strictly forbidden.
  40 

< 0.001 
      1 
  41
if ~(areNamesUnique) 
  42 
    names = matlab.lang.makeUniqueStrings(names, 1:numel(names), namelengthmax);
  43 
    
      1 
  44
end 
  0.010 
      1 
  45
data = cell2struct(values, names, 1); 
      1 
  46
if isempty(data) 
  47 
    data = struct;
      1 
  48
end 
< 0.001 
      1 
  49
end 

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