Programatically set Inport/Outport Blocks as "Output as nonvirtual bus"

조회 수: 10 (최근 30일)
Paul Anderson
Paul Anderson 2021년 12월 22일
답변: Mark McBroom 2021년 12월 23일
We have a hiarchy of models with busses going across model boundries. We need to have all these inports and outports set as nonvirtual bus. If we don't bad things seem to happen with the code. With new programmers coming on we find these check boxes rarely get set. I am looking for a way to either Default the checkbox "Output as nonvirtual bus" to "yes" or programatically interrigate the entire model hiarchy to find all inport and outport and set the check box.

답변 (1개)

Mark McBroom
Mark McBroom 2021년 12월 23일
  1. use find_mdlrefs() to get a list of all referenced models
  2. For each model, use find_system() to get a list of inports and outports
  3. For each inport and each outport, use set_param() to set 'BusOutputAsStruct' to true

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by