필터 지우기
필터 지우기

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 CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by