Effacer les filtres
Effacer les filtres

How to replace a simulink block name which is used in many places inside the model?

1 vue (au cours des 30 derniers jours)
I am using MATLAB 2014b. I want to replace names of the data store memory, data store write, data store read used in my simulink model. Is there any provision to replace just the name of these blocks and not the whole blocks themselves?
I did not find any option for find and replace text in the menu bar or elsewhere. Under Edit menu, the option 'Find & Replaced in Chart' is not accessible. It is really difficult to manually go in all subsystems and replace the names of these blocks.

Réponse acceptée

Maverick
Maverick le 6 Fév 2018
Hello
This can be done using a few lines of matlab script. I have done for DataStoreRead blocks, you can extend this logic for other blocks as well. Let us assume that the new name you want to give for all the data store read blocks is 'xyz'
Blk=find_system(bdroot,'FollowLinks','On','LookUnderMasks','all','FindAll','on','BlockType','DataStoreRead')
for i=1:length(Blk)
set(Blk(i),'DataStoreName','xyz')
end

Plus de réponses (0)

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by