File Exchange

image thumbnail

Reach/Coreach Tool

version 2.2 (1000 KB) by McSCert
The tool highlights data/control flow dependencies in Simulink models and performs model slicing.


Updated 22 Jul 2020

GitHub view license on GitHub

The Reach/Coreach Tool tracks and highlights data flow and control flow in the model. The tool identifies, for some specified Simulink blocks, parts of the model that depend on those blocks (Reach functionality), or parts of the model that the specified blocks depend upon (Coreach functionality). After the dependencies have been identified, the extraneous blocks can be removed via the tool's model slicing function. For installation instructions and instructions on how to use the tool, see doc/ReachCoreach_UserGuide.pdf in the source files.

For more about the capabilities of the tool and how it can be used in model-based development with Simulink, see the two papers:

Vera Pantelic, Steven Postma, Mark Lawford, Monika Jaskolka, Bennett Mackenzie, Alexandre Korobkine, Marc Bender, Jeff Ong, Gordon Marks, Alan Wassyng, “Software engineering practices and Simulink: bridging the gap,” International Journal on Software Tools for Technology Transfer (STTT), 2017, 1-23.

Vera Pantelic, Steven Postma, Mark Lawford, Alexandre Korobkine, Bennett Mackenzie, Jeff Ong, Marc Bender, "A Toolset for Simulink: Improving Software Engineering Practices in Development with Simulink," Proceedings of 3rd International Conference on Model-Driven Engineering and Software Development (MODELSWARD 2015), SCITEPRESS, 2015, 50-61. (Best Paper Award)

Cite As

McSCert (2020). Reach/Coreach Tool (, GitHub. Retrieved .

Comments and Ratings (4)



@Bibigul Shektybayeva: Thank you for bringing these points to our attention! Creating a new model when slicing is not currently supported, but we will look into adding support for this.

Thanks for sharing this toolbox. I tried using it, and found a small mistake. When you catch an error you have a typo(ex. in ReachCoreach.m, line 208):
catch E
if ~strcmp(E.identifier, 'Simulink:Commands:InvSimulinkObjHandle')
You need to use error(E.message) instead of error(E), then it gives the actual error message.

I also have a question, is it possible to create anew sliced model rather than deleting the un-highlighted blocks? I get an error that the block cannot be deleted while the simulation is running. I would appreciate any suggestions :)



See release notes for this release on GitHub:


– Fixed bugs to improve correctness of results.
– Fixed bugs causing errors in different scenarios.
– Colour selection dropboxes in the GUI now show the values of the current colours.
– Updated user guide.


– Major performance improvements when run on large models
– Grounding/terminating unconnected ports after a slice
– Highlighting no longer opens up every subsystem where a block/signal was highlighted

Fixed a minor bug.

Fixed bug involving coreaching from selected lines.

Updating "Other Requirements" field to reflect that the tool has been testing with R2017a.

Updating tool name.

Fixed recursion bugs. Optimized highlighting operation.

Formatted description text.

Fixed bugs regarding highlighting for data stores, if blocks, and use with 2016b.

– Improved usability, handling of buses
– The tool now tracks through For Each subsystems
– Fixed some issues including problems with running the tool on models with data store and Goto/From shadowing

– The accuracy of tracking through If and Switch Case blocks has been increased.
– Fixed bugs in function Clear.
– The colouring is now done with Simulink's built-in highlighting system.

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux