Kaustubha Govind answered another similar question earlier kindly. She mentioned: "Function handles were not supported in Embedded MATLAB Function blocks until fairly recently, additionally, fsolve is not amongst the functions supported for code-generation, which are the only functions that can be used directly in a Embedded MATLAB Function block."
Also she suggested to use "interpreted matlab funcion". This might be the easiest way to do so. Thanks for Kaustubha Govind's answer firstly.
Yet I think interpreted matlab function might cause the simulation slow.
I am wondering if there is other ways to solve this problem?
Hope people with the same experience could discuss here.
Best Answer