interpn not working inside of a Simulink function

조회 수: 4 (최근 30일)
Julien Esposito
Julien Esposito 2021년 11월 17일
답변: Pavan Guntha 2021년 11월 24일
The following function call:
vs = getAeroCoefficientsForVTail( 0, -10 ); works when running on the command line.
But, when running untitled_20210b.mdl, the Embedded Simulink MATLAB function calling getAeroCoefficientsForVTail complains saying "wong number of input arguments.".
This is weird behavior, since calling the function outside of the Embedded Simulink MATLAB function works.
Help appreciated in this very confusing problem.

답변 (1개)

Pavan Guntha
Pavan Guntha 2021년 11월 24일
Hi Julien,
The issue occurs because of the follwing line in the code 'getAeroCoefficientsForVTail.m':
% Line 91:
coefficients = reshape( interpn( alpha_s, beta_s, LUT, alpha_deg, beta_deg, 'linear', -1 ), [1, 71] );
% Specifically the issue is with the arguments to the 'interpn' function.
The following error message is shown when the function is run through both MATLAB/ Simulink:
"The number of input coordinate arrays must match the dimensions of the sample values."
For more information on interpn, you could look at the documentation page here.
Hope it helps!

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by