How to add optional outport to simulink model?

조회 수: 4 (최근 30일)
Daniel Höglinger
Daniel Höglinger 2019년 12월 9일
댓글: Daniel Höglinger 2019년 12월 11일
I have a model that outputs a signal via a normal outport. I would like to create an optional second outport for a normalized version of this same signal.
Currently the block has both outputs, but I would like the second outport to be "hidden" unless explicitly enabled.
So is it possible to add an outport that can be enabled and disabled by a checkbox in the properties of the model/block?

채택된 답변

Jim Riggs
Jim Riggs 2019년 12월 9일
You can use a switch to select between the two different output options that you want, and there are a number of ways to activate the switch:
1) This is a favorite of mine: Define a logical variable (e.g. "UseOutputOption") in the Matlab workspace.to control the switch.
Matlab Answers 20191209.JPG
2) You can use a manual switch inside the model to activate the option:
Matlab Answers 20191209b.JPG
  댓글 수: 2
Jim Riggs
Jim Riggs 2019년 12월 9일
After giving it some more thought, it may be that what you want is a variant subsystem.
Daniel Höglinger
Daniel Höglinger 2019년 12월 11일
Thank you very much for your comprehensive reply, this seems to be the solution for my problem!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Applications에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by