time | Calls | line |
---|
| | 384 | function obj = assignLabels(obj,newLabels,fullAssignment,indices)
|
< 0.001 | 16 | 385 | if fullAssignment
|
< 0.001 | 16 | 386 | if isvector(newLabels)
|
| | 387 | % The number of new labels has to match what's being assigned to.
|
< 0.001 | 16 | 388 | if numel(newLabels) ~= obj.length
|
| | 389 | obj.throwIncorrectNumberOfLabels();
|
< 0.001 | 16 | 390 | end
|
< 0.001 | 16 | 391 | obj.hasLabels = true;
|
< 0.001 | 16 | 392 | obj.labels = newLabels;
|
| | 393 | else % a 0x0
|
| | 394 | % Full assignment of a 0x0 clears out the existing labels, if allowed above by
|
| | 395 | % the subclass's validateLabels.
|
| | 396 | obj.labels = newLabels([]); % force a 0x0, for cosmetics
|
| | 397 | obj.hasLabels = false;
|
< 0.001 | 16 | 398 | end
|
| | 399 | else % subscripted assignment
|
| | 400 | % The number of new labels has to match what's being assigned to.
|
| | 401 | if numel(newLabels) ~= numel(indices)
|
| | 402 | obj.throwIncorrectNumberOfLabelsPartial();
|
| | 403 | end
|
| | 404 | obj.labels(indices) = newLabels;
|
< 0.001 | 16 | 405 | end
|
< 0.001 | 16 | 406 | end
|
Other subfunctions in this file are not included in this listing.