Error using Matlab function in simulink
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all, I need to Model the CDF of a Gaussian in simulink, i defined this matlab function block:
function y = hplus(u)
y = (1/2)*(1+erf((u(1)-MiuPlus)/(SigmaPlus*sqrt(2))));
But when i run it i obtain serveral errors:
Simulink does not have enough information to determine output sizes for this block. If you think the
errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.
Undefined function or variable 'MiuPlus'.
Function 'Heating/h+' (#35.45.52), line 2, column 24:
"MiuPlus"
Errors occurred during parsing of MATLAB function 'Heating/h+'
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'Heating/h+' due to errors in the
block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated
errors, or explicitly specify sizes and/or types for all block outputs.
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'Heating/h+' due to errors in the
block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated
errors, or explicitly specify sizes and/or types for all block outputs.
Component:Simulink | Category:Model error
Error occurred in 'SMA/Heating/h+'.
I don't understand why it doesn't find "MiuPlus" that is defined in the workspace, and have no idea of how to deal with the others errors.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!