For standalone applications, the easiest way is to use Simulink support package and put your MATLAB function inside a MATLAB function block.
As far as I know, I don't think Simulink support package for Raspberry Pi gives you the C code equivalent for the model, it compiles whatever code is written out of the model and provides you with only the executable that you need to run on the raspberry pi.
