Applies a given function to each element of in an array of sets.
A = obj.forEach(@myfun)
A = obj.forEach(@(x) myfun(x))
A = obj.forEach(@(x) x.myfun)
@myfun |
A handle to a function that is to be applied to each element in the array of sets for object obj.
Class: function_handle |
A |
Array or cell array of outputs returned by function @myfun that correspond to individual outputs
from the array of sets obj. Class: |
for i=1:5; P(i)=ExamplePoly.randVrep; endFor each polyhedron in the array execute the function outerApprox
B = P.forEach(@outerApprox)
Array of 5 polyhedra.In B we have computed the outer bounding boxes for each polyhedron in the array. It is the same results if asked
Bnew = P.outerApprox
Array of 5 polyhedra.
U(1) = PolyUnion([ExamplePoly.randVrep;ExamplePoly.randVrep]);
U(2) = PolyUnion([ExamplePoly.randVrep('d',3);ExamplePoly.randVrep('d',3)]);For each polyunion in the array extract the convexity property that is computed by isConvex method.
ts = U.forEach(@isConvex)
ts = 0 0The same result can be obtained by
tn = U.isConvex
tn = 0 0
◀ | mpt | iterablebehavior | ▶ |
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch