Defining the port names of the Smilunk block within the S function

Hello,
Is it possible to define the port names in the S-function(R2013a). Is there a function available to do that.

 채택된 답변

Titus Edelhofer
Titus Edelhofer 2013년 8월 8일

1 개 추천

Hi,
no there isn't. But it is best practice to mask the S-function block anyway (for passing the parameters). In the mask you can name the ports of course as you like.
Titus

댓글 수: 5

Priyanka
Priyanka 2013년 8월 8일
편집: Priyanka 2013년 8월 8일
Thank you Titus for your quick reply.
However I need to mask the block with the names that I get from my s-function. I need to use this names as my output port names.(I am not suppose to declare the names manually in the mask). Can you please help me with this one.
Thank you
Priyanka
Priyanka: Could you explain the motivation for having the port names defined in the S-function, and not in the mask? Currently it is not possible to specify the port names in the S-function, but we may be able to suggest a workaround depending on your motivation.
Kaustubha
My port names are dynamic. I get the names only by triggering another c-function which gives the port names and the number of ports to my s-function. So I need to assign these names to my ports.
Thank you Priyanka
If the labels are coming from another C-function, would you be open to creating a MEX-function wrapper to it, and calling the MEX-function from a Mask that you can create on top of the S-function block.
Kaustubha
I am currently working on creating a MEX-function to my C-function(I am completely new to creating mex functions. So for now, I am learning how to write a mex function). I will post again if I have any questions.
Thank you for your help.
Priyanka

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

추가 답변 (1개)

Priyanka
Priyanka 2013년 8월 13일

0 개 추천

Hello,
Can any one help me with assigning the port names dynamically.My port names keep changing so I cannot mask them individually. Is there any way to do that automatically in the mask(i.e I get port names from my S-function and I want to read them in the initialization commands section of the mask tab and assign them to my ports)
Thank you
Priyanka

카테고리

도움말 센터File Exchange에서 Naming Conventions에 대해 자세히 알아보기

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by