This is a static copy of a profile report

Home

Function details for fft_array_add_zeroThis is a static copy of a profile report

Home

fft_array_add_zero (Calls: 1, Time: 0.008 s)
Generated 07-Jul-2019 01:13:14 using performance time.
function in file C:\Users\fan\CodeDynaAsset\tools\fft_array_add_zero.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ffs_abz_gen_borrsave_gridfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
41
ar_a_wth_zero = sort(unique(ar...
10.006 s75.0%
25
[fl_a_min, fl_a_max, it_a_n] =...
10.001 s9.4%
24
[ar_a, ~] = varargin{:};
10.000 s4.8%
40
if (ismember(0, ar_a))
10.000 s3.7%
17
if (params_len == 2)
10.000 s1.1%
All other lines  0.000 s6.0%
Totals  0.008 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
uniquefunction10.005 s67.4%
dealfunction10.000 s4.9%
ismemberfunction10.000 s0.5%
Self time (built-ins, overhead, etc.)  0.002 s27.2%
Totals  0.008 s100% 
Code Analyzer results
Line numberMessage
30Using CLEAR ALL usually decreases code performance and is often unnecessary.
Coverage results
Show coverage for parent directory
Total lines in function59
Non-code lines (comments, blank lines)24
Code lines (lines that can run)35
Code lines that did run15
Code lines that did not run20
Coverage (did run/can run)42.86 %
Function listing
time 
Calls 
 line
   7 
function [ar_a_wth_zero] = fft_array_add_zero(varargin)
   8 
%% FFT_ARRAY_ADD_ZERO Add zero to array without changing size
   9 
%
  10 

  11 
%% Default
  12 
% use binomial as test case, z maps to binomial win prob, remember binom
  13 
% approximates normal.
  14 

< 0.001 
      1 
  15
params_len = length(varargin); 
      1 
  16
bl_input_override = 0; 
< 0.001 
      1 
  17
if (params_len == 2) 
< 0.001 
      1 
  18
    bl_input_override = varargin{2}; 
      1 
  19
end 
  20 

< 0.001 
      1 
  21
if (bl_input_override) 
  22 

  23 
    % if invoked from outside overrid fully
< 0.001 
      1 
  24
    [ar_a, ~] = varargin{:}; 
< 0.001 
      1 
  25
    [fl_a_min, fl_a_max, it_a_n] = deal(min(ar_a), max(ar_a), length(ar_a)); 
< 0.001 
      1 
  26
    bl_display_addzero = false; 
  27 

  28 
else
  29 

  30 
    clear all;
  31 
    close all;
  32 
    
  33 
    [fl_a_min, fl_a_max, it_a_n] = deal(-20, 50, 11);
  34 
    ar_a = linspace(fl_a_min, fl_a_max, it_a_n);
  35 
    bl_display_addzero = true;
  36 

      1 
  37
end 
  38 

  39 
%% Add in Zero
< 0.001 
      1 
  40
if (ismember(0, ar_a)) 
  0.006 
      1 
  41
    ar_a_wth_zero = sort(unique(ar_a)); 
  42 
else
  43 
    ar_a = linspace(fl_a_min, fl_a_max, it_a_n-1);
  44 
    
  45 
    if (ismember(0, ar_a))
  46 
        % add a mid point between 0 and lowest savings point above zero.
  47 
        ar_a_wth_zero = [(ar_a(2)-ar_a(1))/2, ar_a];
  48 
        ar_a_wth_zero = sort(unique(ar_a_wth_zero));
  49 
    else
  50 
        ar_a_wth_zero = [0 ar_a];
  51 
        ar_a_wth_zero = sort(unique(ar_a_wth_zero));        
  52 
    end
      1 
  53
end 
  54 

  55 
%% Display
      1 
  56
if (bl_display_addzero) 
  57 

  58 
    disp('ar_a');
  59 
    disp(ar_a);
  60 
    
  61 
    disp('ar_a_wth_zero');
  62 
    disp(ar_a_wth_zero);
  63 

  64 
end
< 0.001 
      1 
  65
end 

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