time | Calls | line |
---|
| | 284 | function selection = fixSelection(obj,selection)
|
| | 285 | % Fix the selection from text array of names to numeric selection
|
| | 286 | % or validate the numeric selection.
|
< 0.001 | 4 | 287 | selection = convertCharsToStrings(selection);
|
< 0.001 | 4 | 288 | if isstring(selection)
|
| | 289 | selection = obj.getNumericSelection(selection);
|
< 0.001 | 4 | 290 | elseif isnumeric(selection)
|
< 0.001 | 4 | 291 | if ~all(selection > 0 & isfinite(selection) & floor(selection)==selection & selection <= numel(obj.OptionsStruct.Types))
|
| | 292 | error(message('MATLAB:textio:io:BadNumericSelection'));
|
< 0.001 | 4 | 293 | end
|
| | 294 | elseif islogical(selection)
|
| | 295 | selection = find(selection);
|
| | 296 | else
|
| | 297 | error(message('MATLAB:textio:io:BadSelectionInput'));
|
< 0.001 | 4 | 298 | end
|
< 0.001 | 4 | 299 | end
|
Other subfunctions in this file are not included in this listing.