Clear Filters
Clear Filters

set_param on block inside library

13 views (last 30 days)
Aaron on 18 May 2015
Edited: Aaron on 20 May 2015
I am using the command:
to find blocks in my system. I then am running
on the blocks that have been found to add some labels.
How do I use "set_param" to change parameters inside library links properly. I would imagine I need to disable the link, set the param, and then restore the link -or- open the referenced library for the block and edit the library directly.
Any suggestions/ideas on the best way to do this?
Here is an example of my hierarchy:
mybench -> Subsystem_top -> subsystem_bot -> Constant
Subsystem_top is a library block from mylib_a/Subsystem Subsystem_bot is a library block from mylib_b/Subsystem
The find_system is returning the handle for the constant. I want to use set_param on the constant and update it's properties within the library mylib_b.

Answers (2)

Sreeram Mohan
Sreeram Mohan on 19 May 2015
Hi Aaron,
It purely depends on what is the final intention. For example : Case 1: If you make some changes to the link (that is the block used in the model) and want to propagate the change to all the instances of the block in all models you should do a propagate. In this case Just disable the link, make the set_param and then propagate the change to the library. Case 2: If you want to just locally modify the link and then do not want to keep the relationship with the library. Then you could break the link. If you do so then you permanently loose the relationship with the library. If this is the intention. You just need to break the link and then do set_param at the cost that you no longer have a connection with the library or any other instances and you are working on a stand alone copy or (broken link) .
Hope this helps,
  1 Comment
Aaron on 19 May 2015
Sreeram, Thanks for your response. I do not want to break the link (I should change my wording in the question to "disable link".)
The question is, how do I even disable the link to begin with. The block I found via the "find_system" command contains no information about it's parent library. For example under link status I see "inherited" and I am not able to execute the set_param('LinkStatus'....) on the block itself.
How do you retrieve library link information from a block within a linked library subsystem (that could be multiple levels of hierarchy within the library)?

Sign in to comment.

Sreeram Mohan
Sreeram Mohan on 20 May 2015
Hi Aaron,
If you want to disable a link you would just call set_param(block, 'LinkStatus','inactive');
The table in the link that I have posted has all the values that can help with the library links.
Hope this helps !!
  1 Comment
Aaron on 20 May 2015
Unfortunatly that does not help :) I just updated my original comment with a detail of my hierarchy. As I mention, directly using set_param('LinkStatus',....) on a block within a library does not work.
I could write my own script to go find the parent library but I was hoping there was a built in way to do this.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!