Parameters of a level-2 s function

Hi,
In the Level-2 S function block there is a parameter called "Parameters". Can this name be changed to others, say, "Speed"?
Thanks Senmeis

답변 (2개)

Kaustubha Govind
Kaustubha Govind 2012년 11월 12일

1 개 추천

To create your own parameter prompts, you need to Mask the S-function block and simply enter the names of the dialog parameter variables on the underlying "Parameters" field of the S-function.

댓글 수: 3

Owen
Owen 2012년 11월 14일
Thank you very much.
Senmeis
Owen
Owen 2012년 11월 15일
The name of parameters can be edited with the mask editor, but there is a serious problem: the parameters cannot be passed into the S function!
I have such lines in the S function:
tmp = block.DialogPrm(1).Data; assignin('base', 'x', tmp);
It works without masking, but 'x' cannot get the value of the parameter after masking.
My configuration of the masking looks like this:
prompt = variable1; variable = var1; type = edit; Evaluate and Tunable: Yes.
Did I make some mistakes?
Senmeis
Kaustubha Govind
Kaustubha Govind 2012년 11월 15일
Have you entered "var1" (without quotes) in the underlying Parameters field of the actual S-function dialog? You need to right-click on your block and select Mask>Look Under Mask to see the original S-function dialog.

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

Owen
Owen 2012년 11월 18일

0 개 추천

With my configuration the string "variable1" is showed in the block dialogue. When I input the number 10 in the parameter field of the block dialogue (under the string "variable1") I expect a variable x = 10 will be showed in the workspace but it doesn't.
Thanks Senmeis

댓글 수: 3

Kaustubha Govind
Kaustubha Govind 2012년 11월 19일
When you say workspace, do you mean the Mask Workspace? Also, you did not answer whether you have added var1 to the S-functions Parameters field.
Owen
Owen 2012년 11월 20일
It is the base workspace. The variable name 'x' is there but its value is not correct.
I don't understand what you mean by "added var1 to the S-functions Parameters field". In the block parameter dialogue a number such as 10 should be input. The string "var1" doesn’t exist in the block parameter dialogue.
Senmeis
Kaustubha Govind
Kaustubha Govind 2012년 11월 26일
Owen: Right-click on the masked block and select Mask>Look Under Mask. That should open the underlying S-functions dialog, which should have a field called "Parameters" - enter var1 there.

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

카테고리

도움말 센터File Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

제품

질문:

2012년 11월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by