how to solve this error when i use matlab function

10 次查看(过去 30 天)
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 个评论
翰旭
翰旭 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