User`s guide
Model Coverage for MATLAB Functions
18-25
The local function rect_intersect checks to see if its two rectangle arguments
intersect. Each argument consists of coordinates for the lower-left corner of the rectangle
(origin), and its width and height. x values for the left and right sides and y values for
the top and bottom are calculated for each rectangle and compared in nested if-else
decisions. The function returns a logical value of 1 if the rectangles intersect and 0 if they
do not.
Scope output during simulation, which plots the return value against the sample time,
confirms the intersecting rectangles for sample times 2, 3, and 4 .
After the simulation, the model coverage report appears in a browser window. After the
summary in the report, the Details section of the model coverage report reports on each
parts of the model.
The model coverage report for the MATLAB Function block shows that the block itself
has no decisions of its own apart from its function.
The following sections examine the model coverage report for the example model in
reverse function-block-model order. Reversing the order helps you make sense of the
summary information at the top of each section.