Hi,
Please provide some more info on the model you are trying to build and the code in the matlab function block.
Below is simple Simulink model which uses a Matlab function block :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/361963/image.png)
And the code in the Matlab Function Block is :
function y = fcn(u)
if u > 0
y = 1;
else
y = 0;
end
end
And the output of the Display Block is :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/361966/image.png)
For more information on Simulink Function block check here
For more info please check here