how to solve this error when i use matlab function
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 22 de En. de 2024
The block diagram shows inputs R1, R2, w.
The function definition shows inputs R1, R2, w, f, l
Fangjun Jiang
el 22 de En. de 2024
Editada: Fangjun Jiang
el 22 de En. de 2024
f and l are likely parameters. Parameters are shown in the function input arguments.
翰旭
el 23 de En. de 2024
Walter Roberson
el 23 de En. de 2024
Try
function y = fcn(R1,R2,w,f,l)
y = 0;
y = (1-(R1./R2).^w.*exp(-f.*l./R2);
翰旭
el 25 de En. de 2024
Respuestas (1)
Fangjun Jiang
el 22 de En. de 2024
0 votos
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.
Categorías
Más información sobre Programmatic Model Editing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
