strjust (Calls: 56, Time: 0.010 s)
Generated 16-Jul-2020 17:09:46 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/strfun/strjust.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
num2str>strvrcat | subfunction | 56 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
22 | t = strjustOnChar(s, justify); | 56 | 0.009 s | 91.2% | |
21 | if ischar(s) || isnumeric(s) | 56 | 0.000 s | 3.0% | |
15 | if nargin<2 | 56 | 0.000 s | 1.6% | |
36 | end | 56 | 0.000 s | 0.2% | |
16 | justify = 'right'; | 56 | 0.000 s | 0.1% | |
All other lines | 0.000 s | 3.8% | |||
Totals | 0.010 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
strjust>strjustOnChar | subfunction | 56 | 0.008 s | 85.4% | |
Self time (built-ins, overhead, etc.) | 0.001 s | 14.6% | |||
Totals | 0.010 s | 100% |
Line number | Message |
Total lines in function | 36 |
Non-code lines (comments, blank lines) | 15 |
Code lines (lines that can run) | 21 |
Code lines that did run | 7 |
Code lines that did not run | 14 |
Coverage (did run/can run) | 33.33 % |
time | Calls | line | |
---|---|---|---|
1 | function t = strjust(s,justify) | ||
2 | %STRJUST Justify character array. | ||
3 | % T = STRJUST(S) or T = STRJUST(S,'right') returns a right justified | ||
4 | % version of S. S can be a character array, string array, or cell array | ||
5 | % of character arrays. | ||
6 | % | ||
7 | % T = STRJUST(S,'left') returns a left justified version of S. | ||
8 | % | ||
9 | % T = STRJUST(S,'center') returns a center justified version of S. | ||
10 | % | ||
11 | % See also DEBLANK, STRTRIM. | ||
12 | |||
13 | % Copyright 1984-2016 The MathWorks, Inc. | ||
14 | |||
< 0.001 | 56 | 15 | if nargin<2 |
< 0.001 | 56 | 16 | justify = 'right'; |
17 | else | ||
18 | justify = lower(justify); | ||
< 0.001 | 56 | 19 | end |
20 | |||
< 0.001 | 56 | 21 | if ischar(s) || isnumeric(s) |
0.009 | 56 | 22 | t = strjustOnChar(s, justify); |
23 | elseif iscellstr(s) || isstring(s) | ||
24 | t = s; | ||
25 | num = numel(s); | ||
26 | for i = 1:num | ||
27 | textArray = s{i}; | ||
28 | if ~ischar(textArray) | ||
29 | error(message('MATLAB:strjust:InputMustBeText')); | ||
30 | end | ||
31 | t{i} = strjustOnChar(textArray, justify); | ||
32 | end | ||
33 | else | ||
34 | error(message('MATLAB:strjust:InputMustBeText')); | ||
< 0.001 | 56 | 35 | end |
< 0.001 | 56 | 36 | end |
Other subfunctions in this file are not included in this listing.