How to replace a simulink block name which is used in many places inside the model?
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Maverick
2018-2-6
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!