I haven't run the code, but your are using the inputs in the mdlOutput function without defining the them as having Directfeedthrough.
I suspect you need to define
block.InputPort(1).DirectFeedthrough = true;
block.InputPort(2).DirectFeedthrough = true;
I suspect you need to define
block.InputPort(1).DirectFeedthrough = true;
block.InputPort(2).DirectFeedthrough = true;