フィルターのクリア

How to pass mask parameters to the an underlying S-Function in Simulink?

21 ビュー (過去 30 日間)
James Floyd
James Floyd 2022 年 8 月 9 日
回答済み: Aiswarya 2023 年 10 月 18 日
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:
Mask Edit Window
Internal portion of the mask
Underlying S-Function parameters dialog box

回答 (1 件)

Aiswarya
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:

カテゴリ

Help Center および File ExchangeBlock and Blockset Authoring についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by