simulink & Matlab-Fcn :undefined input argument error

조회 수: 1 (최근 30일)
leila
leila 2012년 6월 15일
I'm working on a Simulink model containing a MATLAB Fcn block. For example in a function like 'TEST' ,
function z = TEST(x,y)
u = round(x);
v = round(y);
z = u + v;
I have to define input variables of the block at the beginning of the function because this error is occurred:
??? Error due to multiple causes.
Caused by:
Input argument "y" is undefined.
Error evaluating MATLAB function in 'TEST/MATLAB Fcn'
But I can not define "y" because the "x" and "y" are supposed to be defined during the simulation…
How can I send input variables of the MATLAB Fcn block to the function that is written for it?
Thank you.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 6월 18일
Does the MATLAB Fcn block show up with two input ports on the Simulink model? I suspect that you may have unwittingly configured "y" as a parameter. To verify this, double-click on the block to open the Editor window, select Tools>Edit Data/Ports. Then select "y" on the left pane and ensure that "Scope" is set to "Input".

카테고리

Help CenterFile Exchange에서 String에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by