Error using Matlab function in simulink
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!