How to pass mask parameters to the an underlying S-Function in Simulink?
25 次查看(过去 30 天)
显示 更早的评论
I'm trying to create an animation based on the built-in 'saeroanim' 6DoF Animation block in Simulink for R2020a. I'm using a mask to pass defined parameters to the modified S-Function block (I'm implementing a moving target), but I get this error message:
For S-function 'saeroanim_movingtarget', the number of defined parameters, 0, does not match the number of parameters on the dialog of 'Config_3_Missile/6DoF Animation Moving Target/Animation S-Function', 1. These two values must be identical.
In the initialization tab, I have this:
s_funcConfig.axes = axes;
s_funcConfig.update = update;
s_funcConfig.missile = missile;
s_funcConfig.target = target;
s_funcConfig.camera_pos = camera_pos;
s_funcConfig.view = view;
s_funcConfig.Animenable = animenable;
s_funcConfig.Model = bdroot(gcb);
"s_funcConfig" is the struct that I want to define for the S-Function inside the mask. Why is the mask not defining s_funcConfig as a "defined parameter" and then passing it to the dialog of the internal S-Function?
Some pictures:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092575/image.png)
Mask Edit Window
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092580/image.png)
Internal portion of the mask
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092585/image.png)
Underlying S-Function parameters dialog box
0 个评论
回答(1 个)
Aiswarya
2023-10-18
Hi,
The error you are getting indicates that the number of parameters in the compiled S-function is different than the number of parameters in the block dialog box. This means you have not defined any parameters in the S-function code but the dialog has a parameter s_funcConfig . The mask is not responsible to define a parameter for the S-function. You may need to check the S-function code and make sure you have defined that parameter. Refer to this link on more information on setting parameters for S-function:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Block and Blockset Authoring 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!