time | Calls | line |
---|
| | 243 | function rhs = validateRange(rhs,propname,orientationValidator,numElems)
|
< 0.001 | 10 | 244 | rhs = convertStringsToChars(rhs);
|
< 0.001 | 10 | 245 | if ischar(rhs)
|
< 0.001 | 10 | 246 | rhs = strtrim(rhs);
|
< 0.001 | 10 | 247 | end
|
< 0.001 | 10 | 248 | if isempty(rhs)
|
< 0.001 | 5 | 249 | rhs = '';
|
< 0.001 | 5 | 250 | return;
|
< 0.001 | 5 | 251 | end
|
< 0.001 | 5 | 252 | try
|
< 0.001 | 5 | 253 | if isscalar(rhs) && isnumeric(rhs)
|
| | 254 | % Scalar is supported, number of row/column
|
| | 255 | if any(floor(rhs)~=rhs) || (rhs <= 0) || isinf(rhs)
|
| | 256 | error(message('MATLAB:spreadsheet:importoptions:InvalidScalarLocation',propname));
|
| | 257 | end
|
| | 258 | % Convert to double
|
| | 259 | rhs = double(rhs);
|
< 0.001 | 5 | 260 | else
|
| | 261 | % Either four element vector or range string.
|
< 0.001 | 5 | 262 | [type, rangesize] = ...
|
| 5 | 263 | matlab.io.spreadsheet.internal.validateRange(rhs);
|
0.002 | 5 | 264 | orientationValidator(propname,type,rangesize,numElems);
|
< 0.001 | 5 | 265 | end
|
| | 266 | catch ME
|
| | 267 | if propname=="DataRange" && ismember(ME.identifier,{'MATLAB:spreadsheet:sheet:invalidRangeSpec',...
|
| | 268 | 'MATLAB:spreadsheet:sheet:rangeParseInvalid'})
|
| | 269 | error(message('MATLAB:spreadsheet:importoptions:InvalidDataRange'));
|
| | 270 | end
|
| | 271 | throwAsCaller(ME)
|
< 0.001 | 5 | 272 | end
|
< 0.001 | 5 | 273 | end
|
Other subfunctions in this file are not included in this listing.