Cannot override parameters in Simulink model configuration reference

I am using MATLAB R2021b on Ubuntu 20.04. I have created a Simulink model that uses a configuration reference (the configuration exists in the base workspace). This configuration has also been propagated to multiple reference models in my model. When trying to override one of the parameters in my top level model, the "override" menu option is greyed out and I cannot override the parameter. How may I override this parameter?

댓글 수: 2

Is the parameter defined as a configuration parameter?
If thats the case, you can modify the configuration object to make the parameter tunable.
This can be done by setting the "AllowTuning" property of the configuration object to true.
Thank you for your suggestion; I am not sure how to check if the parameter is a configuration parameter, could you let me know how I may do this?
The Simulink model that I referred to in my question is being run using the "Monitor and Tune" (external mode) feature of the ROS toolbox. After posting my original question, I found that if I restarted MATLAB and opened the Simulink model, I could override the parameter (i.e., the "override" option was not greyed out as in the screenshot above). However, after I ran the model one time using "Monitor and Tune", I could no longer override any parameters. I believe this may be a bug as I did not encounter this issue in the past when using R2021b on Ubuntu 18.04 (rather than 20.04 as I am now).

댓글을 달려면 로그인하십시오.

답변 (1개)

Jonas
Jonas 2023년 4월 24일

0 개 추천

You can only adapt the Configuration Parameters object, not the Configuration Reference object. You need to adapt the Configuration Parameters in the base workspace.

댓글 수: 3

Unless I am mistaken, I thought that though you cannot modify the configuration parameters using the configuration reference object, it is possible to override some of them for individual models. In this case, for example, I am using the same configuration parameter reference for the top level model and many other models that are referenced using Model blocks. While the values for most parameters should be the same for the top level model and each of the Model blocks, I wanted to use the override feature to change the parameter values for only a few specific parameters for some of the referenced models.
I believe the issue I described may be a bug; see the comment I wrote under my original question.
It seems like not all parameters can be overriden. Some allow overriding, others have the override feature greyed out. Are you not able to override any parameter inside the Configuration Reference object?
I wasn't able to override any parameters after running the model in Monitor and Tune mode unless I restarted MATLAB/Simulink. After doing so, I was able to override the necessary parameters (e.g., "Periodic sample time constraint"). I still think this may be a bug but I was able to avoid the issue with this approach.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2023년 4월 20일

댓글:

2023년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by