time | Calls | line |
|---|
| | 1 | function [args,strargs,narg] = subplot_parseargs(args)
|
| | 2 | % Helper function used by subplot for separating out name/value pairs and
|
| | 3 | % string arguments from other arguments. entries out of the pvpair list.
|
| | 4 | % Note that the arguments may include a three digit string as the first
|
| | 5 | % input argument, which represents 'mnp'. That will be separated out into
|
| | 6 | % three separate numeric input arguments for [m, n, p].
|
| | 7 |
|
| | 8 | % Copyright 2015-2017 The MathWorks, Inc.
|
| | 9 |
|
| | 10 | % Check if the first input argument is a string representing 'mnp'
|
| | 11 | % If so, convert it to three separate numeric inputs.
|
| | 12 |
|
| | 13 | import matlab.graphics.internal.*;
|
0.006 | 4 | 14 | if numel(args)>=1 && isCharOrString(args{1}) ... % it is a string
|
| | 15 | && numel(args{1})==3 ... % it has three characters
|
| | 16 | && all(args{1} >= '0' & args{1} <= '9') % characters are between 0-9
|
| | 17 |
|
| | 18 | args = [{str2double(args{1}(1)) ,... % first character
|
| | 19 | str2double(args{1}(2)) ,... % second character
|
| | 20 | str2double(args{1}(3))},... % third character
|
| | 21 | args(2:end)];
|
< 0.001 | 4 | 22 | end
|
| | 23 |
|
0.004 | 4 | 24 | args = convertStringToCharArgs(args);
|
| | 25 |
|
| | 26 | % Find the first string input.
|
| | 27 | % (append true so that firststr is never empty)
|
0.003 | 4 | 28 | firststr = find([cellfun(@ischar,args), true],1);
|
| | 29 |
|
| | 30 | % Split the arguments at the first string input.
|
0.002 | 4 | 31 | strargs = args(firststr:end);
|
0.001 | 4 | 32 | args = args(1:firststr-1);
|
< 0.001 | 4 | 33 | narg = numel(args);
|
| | 34 |
|
< 0.001 | 4 | 35 | end
|
Other subfunctions in this file are not included in this listing.