Errors with s-function level 1 in simulink

I am modeling a separator model with pressure and water level as 2 variables.
I first made an m-file(hamda.m) with ode23tb, which is working( 4 plots: pressure, water level, flow of liq output and flow of gas output.
then I used an level 1 s-function( gabileh) applying the m-file(hamda.m) I created as fellow
function [sys,x0,str,ts,simStateCompliance] = gabileh(t,x,u,flag,varargin)