Last change
on this file since 17 was
17,
checked in by zhangj, 11 years ago
|
To have a stable version on the server.
|
-
Property svn:executable set to
*
|
File size:
1007 bytes
|
Line | |
---|
1 | function OutputVector=idAuxLargestIntersectionOfVectors(Vector1, Vector2) |
---|
2 | %% Written by F.Briquez 25/04/2011 |
---|
3 | % Returns the outter limits of the vector included in both Vector1 and |
---|
4 | % Vector2 |
---|
5 | % 1) Inputs : Vector1 : (1xN1) array. Must be increasing monotonic! |
---|
6 | % Vector2 : (1xN2) array. Must be increasing monotonic! |
---|
7 | % 2) Output : Vector (1x2) = [lower limit, upper limit] |
---|
8 | % 3) Returns empty array [] if failed |
---|
9 | |
---|
10 | %% |
---|
11 | OutputVector=[]; |
---|
12 | |
---|
13 | N1=length(Vector1); |
---|
14 | N2=length(Vector2); |
---|
15 | |
---|
16 | for i=1:N1-1 |
---|
17 | if (Vector1(i)>Vector1(i+1)) |
---|
18 | fprintf ('Error in ''idAuxLargestIntersectionOfVectors'' : Vector1 must be increasing monotonic\n'); |
---|
19 | return |
---|
20 | end |
---|
21 | end |
---|
22 | for i=1:N2-1 |
---|
23 | if (Vector2(i)>Vector2(i+1)) |
---|
24 | fprintf ('Error in ''idAuxLargestIntersectionOfVectors'' : Vector2 must be increasing monotonic\n'); |
---|
25 | return |
---|
26 | end |
---|
27 | end |
---|
28 | ResultStart=max(Vector1(1), Vector2(1)); |
---|
29 | ResultEnd=min(Vector1(length(Vector1)), Vector2(length(Vector2))); |
---|
30 | OutputVector=[ResultStart, ResultEnd]; |
---|
Note: See
TracBrowser
for help on using the repository browser.