Hi, you must write an M-File like this example:
------------------------------------------------
function y=check_jib(x)
if x<0
error('jib is not defined');
else
y=x;
end
--------------------------------------------------
and save it as check_jib.m
Then write your functionname in the "MATLAB-Function-Block"
If the if expression is true, the simulation stops and gives out the error message