Retrieve Source Library Info.
6 次查看(过去 30 天)
显示 更早的评论
Is there any to retrieve the 'source library info' of any simulink block inside an already existing simulink model?
This will be useful for validating whether the simulink block belongs to particular Simulink library or not.
0 个评论
回答(2 个)
Dheeraj
2024-7-25
Hi jishnusekhar,
You can check the Source Library information of a Simulink block within a Simulink Model by right-clicking on the block and selecting "Help." This action will redirect you to the block's documentation page, where the Source Library information is displayed at the top.
Thank you.
Karan Singh
2024-7-25
If you are looking for the exact block's source path then you youuse the property of "get_params" for "blocks", I have found one as 'ReferenceBlock', which returns the name of the library block to which this block links.
Here is the code I have followed which you can convert into a matlab script to be an autonomous process-
>> blocks = find_system('untitled1', 'Type', 'Block');
>> block = blocks{1};
>> sourceLibrary = get_param(block, 'ReferenceBlock');
>> sourceLibrary
sourceLibrary =
'hdlsllib/HDL RAMs/HDL FIFO'
And here are is SC of the same
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1740596/image.png)
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!