time | Calls | line |
|---|
| | 1 | function tf = isMatchingSize(arraySize, sz)
|
| | 2 | %MATLAB.LANG.INTERNAL.ISMATCHINGSIZE Compares array size with specified size.
|
| | 3 | % tf = MATLAB.LANG.INTERNAL.ISMATCHINGSIZE(A,B) compares size vectors A
|
| | 4 | % and B. A is normally the result of calling function size on an array. B
|
| | 5 | % is a coded size vector where value -1 represents unrestricted dimension
|
| | 6 | % length that matches any demension length. The function returnes scalar
|
| | 7 | % logic value true if all respective element values from the vectors
|
| | 8 | % match. Trailing values of 1 from B are ignored.
|
| | 9 |
|
| | 10 | % Copyright 2019 The MathWorks, Inc.
|
| | 11 |
|
< 0.001 | 4 | 12 | if ~isvector(arraySize)
|
| | 13 | tf = false;
|
| | 14 | return;
|
| 4 | 15 | end
|
< 0.001 | 4 | 16 | if numel(sz) < numel(arraySize)
|
| | 17 | % size(array) = [1,2,3], sz = [1,2]
|
| | 18 | tf = false;
|
| | 19 | return;
|
| 4 | 20 | end
|
< 0.001 | 4 | 21 | for i=1:numel(arraySize)
|
< 0.001 | 8 | 22 | if sz(i) ~= -1 && arraySize(i) ~= sz(i)
|
| | 23 | % size(array) = [m,n], sz = [m,xn]
|
| | 24 | % size(array) = [m,n], sz = [:,xn]
|
| | 25 | tf = false;
|
| | 26 | return;
|
| 8 | 27 | end
|
< 0.001 | 8 | 28 | end
|
< 0.001 | 4 | 29 | for i=numel(arraySize)+1:numel(sz)
|
| | 30 | if sz(i) ~= -1 && sz(i) ~= 1
|
| | 31 | % size(array) = [1,2], sz = [1,2,3]
|
| | 32 | tf = false;
|
| | 33 | return;
|
| | 34 | end
|
| | 35 | end
|
| | 36 | % size(array) = [m,n], sz = [m,n]
|
| | 37 | % size(array) = [m,n], sz = [m,-1]
|
| | 38 | % size(array) = [m,n], sz = [m,n,1]
|
| 4 | 39 | tf = true;
|
< 0.001 | 4 | 40 | end
|
Other subfunctions in this file are not included in this listing.