time | Calls | line |
---|
| | 1 | function data = parenReference_1D(data,rowIndices)
|
| | 2 | %PARENREFERENCE_1D Subscripting helper for 1D paren reference.
|
| | 3 | % DATA = PARENREFERENCE_1D(DATA,ROWINDICES) returns the specified
|
| | 4 | % rows from a column vector, i.e. DATA(ROWINDICES). PARENREFERENCE_1D
|
| | 5 | % has an optimized special case when ROWINDICES is ':'.
|
| | 6 |
|
| | 7 | % Copyright 2019-2020 The MathWorks, Inc.
|
| | 8 |
|
0.031 | 618310 | 9 | if ischar(rowIndices) && isscalar(rowIndices) && (rowIndices == ':') % inline matlab.internal.datatypes.isColon
|
| | 10 | data = data(:); % literal colon for performance
|
0.025 | 618310 | 11 | else
|
0.027 | 618310 | 12 | data = data(rowIndices);
|
0.085 | 618310 | 13 | end
|