MATLAB: Implementig user-define function in Simulink

user-define function

Hi
I'd like to use m-file function (custom Kalman filter) in my Simulink model. Witch block of User-Defined functions is more suitable for implementation? Can I use Embedded MATLAB Function block in this case?

Best Answer

Yes, you can use Embedded MATLAB function. But if your M-function is already done and you don't need to generate C code for it, you can use your M-function directly using the "Fcn" block or "MATLAB Fcn" block.