how to solve this error when i use matlab function

조회 수: 8 (최근 30일)
翰旭
翰旭 2024년 1월 22일
댓글: 翰旭 2024년 1월 25일
Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types
function y = fcn(R1,R2,w,f,l)
y = (1-(R1/R2)^w*exp(1)^(-f*l/R2));
  댓글 수: 5
Walter Roberson
Walter Roberson 2024년 1월 23일
Try
function y = fcn(R1,R2,w,f,l)
y = 0;
y = (1-(R1./R2).^w.*exp(-f.*l./R2);
翰旭
翰旭 2024년 1월 25일
sorry! i try this code, but the same problem still occurs.

댓글을 달려면 로그인하십시오.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 1월 22일
Make sure your function is correct. Manually give a numerical example value to obtain the resulting y value.
In the MATLAB Function block editor, click "Edit data" and specify the size of y, for example, 1, or [2,3] or whatever.

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by