Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Abel
Posts:
31
Registered:
5/29/13


The simplest way to intersect some intervals ?
Posted:
Jun 27, 2013 5:21 AM


Hi,
Let's say I have this interval :
A=[1:4];
And this matrix :
X=[1 4; 2 3; 3 5;];
What I want is to intersect A with each line of X, each line being counted as an interval of integers : for example I want [1 4] to be processed as [1:4], [2 3] as [2:3] ect.
intersect(A,[2:3]) works of course and returns : 2 3 but it is not possible to do something like intersect(A,X). How could I do this and, if possible, without using a for loop ?



