MATLAB: How to generate a report containing statistics on the contents of a Simulink block diagram

marellimetricmodelsimulinkstateflow

I would like to be able to select a menu option or run a function which would generate a report containing the following information on a Simulink block diagram or subsystem:
1. Number of input ports and the size and type of each port.
2. Number of output ports and the size and type of each port.
3. Number of Stateflow charts and further details about any charts.
4. All parameters used by any block in the subsystem.

Best Answer

The ability to generate a report on the contents of a Simulink diagram is not available in Simulink.
To work around this issue, some of this information can be obtained by using the SLDIAGNOSTICS function. Alternatively, a user-contributed tool for gathering statistics on Simulink models is available on MATLAB Central.
The tool is called "The Modeling Metric Tool" and can be downloaded from the MATLAB Central File Exchange website:
Note that MathWorks does not guarantee or warrant the use or content of these submissions. Any questions, issues, or complaints should be directed to the contributing author.