Function handle in .mod file

I need to use the integral function of Matlab in my .mod file. Dynare does not recognize the function handle I use in the first argument. I tried to declare the function handle as an external function (as I did for the integral function), but Dynare still can not recognize it.

Is it possible to declare it or should I use a different strategy?

Another question, I am using the integral function because I have to use the expected value of a variable from 0 to a variable that represents the threshold of the expected value I am trying to estimate ( integral(x*density, 0, omegaBar), where omegaBar is a variable in my .mod file). I am having a lot of problems computing my steady state using this method, is there another way to get an approximation of this expected value I need?

Thank you in advance.

Generally, use a steady state file. There, you can use every function you like. Within the mod-file, using the integral as an external function is problematic due to Dynare trying to take derivatives.

Thanks you jpfeifer.