Reputation: 11
There is a function in Matlab R2018b, getSimulinkBlockHandle
, but it doesn't exist in R2013b. I want to know how I can get the handle of a Simulink block without this function. I need it to use the function get(h,'parameters')
.
Upvotes: 0
Views: 1531
Reputation: 25140
Just use get_param
and set_param
with the block name instead of the block handle.
EDIT
It seems from the comments that the OP wishes to deal with Simulink annotations, rather than ordinary blocks. This is slightly more complicated because annotations don't have block names. Here's an example
% Open the "vdp" model
open_system('vdp');
% Find annotations
annotations = find_system(gcs,'FindAll','on','Type','annotation');
% Set the background colour to green for the first of these
set_param(annotations(1), 'BackgroundColor', 'green')
More here: https://uk.mathworks.com/help/simulink/ug/create-an-annotation-programmatically.html
Upvotes: 2