Changing property 'BlockReduction' is not allowed

4 ビュー (過去 30 日間)
Praveen
Praveen 2018 年 2 月 2 日
回答済み: Saurabh 2025 年 6 月 18 日
i am trying to slice the simulink model using model slicer option in matlab-2017b. But getting below erorr: Changing property 'BlockReduction' is not allowed can anyone please help me what is the root cause of this error and how to resolve? thank you

回答 (1 件)

Saurabh
Saurabh 2025 年 6 月 18 日
I understand that you are encountering the mentioned error while using the Model Slicer in MATLAB R2017b.
It's because Simulink forbids changing this configuration parameter at runtime. This setting must be defined before initiating the slice.
The root cause is that the 'Model Slicer' attempts to modify the 'BlockReduction' parameter during slice generation, but Simulink restricts changes to that setting once the model is loaded.
To resolve the issue:
Configure 'BlockReduction' Before Slicing.
  1. Open Configuration Parameters.
  2. Navigate to Debug (or Simulation Options) → find Block Reduction setting.
  3. Set it to the preferred mode (on or off) and click Apply.
  4. Alternatively, execute in the Command Window:
set_param('model_name', 'BlockReduction', 'off'); % or 'on'
save_system('model_name');
Restart the Model Slicer: Ensure the model is saved with the new setting before launching Model Slicer again.
This works because Simulink locks certain parameters, including 'BlockReduction', to preserve model integrity during runtime. Changing them post-load triggers the error. By setting the parameter before using the slicer, it avoids runtime violations
I hope this helps.

カテゴリ

Help Center および File ExchangeModel Simplification with Dependency Analysis についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by