www.gusucode.com > slcontrol 案例源码程序 matlab代码 > slcontrol/AddBusElementsAsOpeningsExample.m
%% Add Bus Elements as Openings % Open the |scdbusselection| model. % Copyright 2015 The MathWorks, Inc. mdl = 'scdbusselection'; open_system(mdl); %% % Create an |slLinearizer| interface for the model. sllin = slLinearizer(mdl); %% % The |COUNTERBUS| signal of |scdbusselection| contains multiple bus elements. % Add the |upper_saturation_limit| and |data| bus elements as openings % to |sllin|. When adding elements within a nested bus structure, use dot % notation to access the elements of the nested bus, for example % |limits.upper_saturation_limit|. blk = {'scdbusselection/COUNTERBUSCreator','scdbusselection/COUNTERBUSCreator'}; port_num = [1 1]; bus_elem_name = {'limits.upper_saturation_limit','data'}; %% % Both bus elements originate at the first (and only) port of the % |scdbusselection/COUNTERBUSCreator| block. Therefore, |blk| and |port_num| % repeat the same element twice.