time | Calls | line |
---|
| | 1 | function sub = subRange(range,span,orientation)
|
| | 2 | %SUBRANGE subdivide a range
|
| | 3 | % range - a four element range vector [startRow startColumn numRow numColumn]
|
| | 4 | % span - the column to use, or a start and end column to use.
|
| | 5 | % orientation - 'column' (default) or 'row'.
|
| | 6 | %
|
| | 7 | % Returns a four element range of only the columns/row of interest.
|
| | 8 |
|
| | 9 | % Copyright 2016 The MathWorks, Inc.
|
| | 10 |
|
< 0.001 | 10 | 11 | sub = range;
|
| | 12 | %Select the span of columns
|
< 0.001 | 10 | 13 | width = span(end) - span(1) + 1;
|
< 0.001 | 10 | 14 | if ~exist('orientation','var') || strcmp(orientation,'column')
|
< 0.001 | 10 | 15 | sub(2) = range(2) + span(1) - 1;
|
< 0.001 | 10 | 16 | sub(4) = width;
|
| | 17 | else
|
| | 18 | sub(1) = range(1) + span(1) - 1;
|
| | 19 | sub(3) = width;
|
< 0.001 | 10 | 20 | end
|
< 0.001 | 10 | 21 | end
|
Other subfunctions in this file are not included in this listing.