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!