How can I change the port names of an S-Function block within the MATLAB File S-Function in Simulink 7.1 (R2008a)?
조회 수: 22 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2012년 6월 21일
편집: MathWorks Support Team
2022년 11월 22일
I would like to change the port names of an S-Function block from within the Level-2 MATLAB File S-Function.
채택된 답변
MathWorks Support Team
2022년 11월 10일
편집: MathWorks Support Team
2022년 11월 22일
The ability to change port names of an S-Function from within a Level-2 MATLAB File S-Function is not available in Simulink.
The workaround is to mask the block in order to create your custom input and output port names. I have attached an example with this e-mail that shows a masked subsystem with port labels that were created with the PORT_LABEL command.
In order to set up something similar with your S-Function block, please do the following:
1. Select the S-Function block and all the signal lines going in and leaving the block.
2. Right-click the block and select "Create Subsystem" from the context menu.
3. Right-click the subsystem block and select "Create Mask" from the context menu. The Mask Editor window will pop up.
4. In the "Icon & Ports" tab, under "Icon Drawing commands", you can write PORT_LABEL commands as shown in the following document:
5. To make further edits, you can right-click the Subsystem block and select "Edit Mask" from the context menu.
You can also consider creating the mask programmatically, by following the steps detailed in the documentation:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!