MATLAB: How to programmatically find a System Requirements block

blocktypefind_systemRequirementssimulinkSimulink Requirementssystem

I am using a System Requirements block in my model, and would like to find its location programmatically using the "find_system" command. What argument do I use with the "BlockType" parameter to find the System Requirements blocks? So far, I have tried "SystemRequirements", "SystemReq", and "System Requirements", but none of these work.

Best Answer

The System Requirements block is actually implemented as a subsystem. If you use the following "find_system" command on your model, you will find that your System Requirements block will be on the output list, along with other subsystems in your model.
>> find_system(gcs,'BlockType','SubSystem')
Instead, you can identify just System Requirement blocks and not all subsystems using the "id" field. For example, if you use the following "find_system" command on your model, you will see an output list of just the System Requirement blocks and not all subsystems.
>> find_system(gcs,'id','SystemReq')