how to solve this error when i use matlab function

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 月 22 日
The block diagram shows inputs R1, R2, w.
The function definition shows inputs R1, R2, w, f, l
Fangjun Jiang
Fangjun Jiang 2024 年 1 月 22 日
編集済み: Fangjun Jiang 2024 年 1 月 22 日
f and l are likely parameters. Parameters are shown in the function input arguments.
翰旭
翰旭 2024 年 1 月 23 日
thank for your advice but i change the input ;problem also exist
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 日

0 投票

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.

カテゴリ

ヘルプ センター および File ExchangeProgrammatic Model Editing についてさらに検索

質問済み:

2024 年 1 月 22 日

コメント済み:

2024 年 1 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by