There are two matrices, A
and B
with size m
-by-4 and n
-by-4 respectively. My question is how to apply a function f<
This functionality is built into rectint
. For the syntax rectint(A,B)
:
A
andB
can also be matrices, where each row is a position vector.AREA
is then a matrix giving the intersection of all rectangles specified byA
with all the rectangles specified byB
. That is, ifA
isM-by-4
andB
isN-by-4
, thenAREA
is anM-by-N
matrix...
So, you can just do result = rectint(A,B);
to get the matrix you are after.