Clear Filters
Clear Filters

Change signal labels of bus selector using code

30 views (last 30 days)
Hey,
I have a very large model and initially I have given random names to signal labels. Now I have somewhat achieved what I wanted wth my model, and I wish to make some minor modifications such as changing the signal labels. I do not wish to do it manually.
I was trying to change the signal labels for signals coming out of bus selector. I am using the
find_system and set functions to do this task but not able to do so. Issue is that bus selector does not find the new signal name.
I am able to change the name manually without any issue.
How to change the signal labelsof bus selector using code?

Accepted Answer

Shubham
Shubham on 11 Sep 2024 at 17:59
Hey Tom,
I understand that you wish to change the names of the signal labels associated with the Bus Selector Block programmatically.
The reason you are unable to change the signal names through a simple code script is because the Bus Selector Block treats the input signals as a read-only object.
Since the Bus Selector block treats certain parameters as read-only such as input signals, we cannot modify the signal name programmatically. The modification needs to be done manually in this case.
You can also refer to the following MATLAB Answer for more information about changing the signal labels programmatically in the case of Bus Selector Block: https://www.mathworks.com/matlabcentral/answers/306781-bus-selector-cannot-find-signals-where-the-name-has-been-changed-programmatically#answer_1504499?s_tid=prof_contriblnk
I hope this helps!

More Answers (0)

Categories

Find more on Interactive Model Editing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!