time | Calls | line |
---|
| | 61 | function obj = lengthenTo(obj,maxIndex,newLabels)
|
< 0.001 | 785 | 62 | if nargin < 3
|
| | 63 | % If the table has row names, create default names for the new rows, making sure
|
| | 64 | % they don't conflict with existing names. If the table has no row names, leave
|
| | 65 | % them that way.
|
< 0.001 | 785 | 66 | if obj.hasLabels
|
| | 67 | newIndices = (obj.length+1):maxIndex; % don't create this unless needed
|
| | 68 | newLabels = obj.dfltLabels(newIndices);
|
| | 69 | newLabels = matlab.lang.makeUniqueStrings(newLabels,obj.labels);
|
| | 70 | obj.labels(newIndices,1) = newLabels(:);
|
< 0.001 | 785 | 71 | end
|
| | 72 | else
|
| | 73 | % If the original table doesn't have row names, create default names.
|
| | 74 | if ~obj.hasLabels
|
| | 75 | obj.labels = obj.dfltLabels(1:obj.length);
|
| | 76 | obj.hasLabels = true;
|
| | 77 | end
|
| | 78 |
|
| | 79 | % Assume that newLabels has already been checked by validateNativeSubscripts,
|
| | 80 | % and that the new names don't conflict with existing names.
|
| | 81 | newIndices = (obj.length+1):maxIndex; % don't create this unless needed
|
| | 82 | obj.labels(newIndices,1) = newLabels(:)';
|
< 0.001 | 785 | 83 | end
|
0.003 | 785 | 84 | obj.length = maxIndex;
|
< 0.001 | 785 | 85 | end
|
Other subfunctions in this file are not included in this listing.