An easy way to execute complicated functions in Simulink is to use the Embedded MATLAB Function block. When you insert one of these blocks it creates a MATLAB file that is contained within the Simulink model block. The issue with this block is that only a subset of the full MATLAB language is available within an Embedded block. The simple solution to this problem is the function eml.extrinsic which sets certain functions to execute externally.
[outputa outputb] = myfunction(inputa, inputb);
The function names within the extrinsic call will be set to run within MATLAB instead of Simulink. Now functions like tf and ss can be used!
Another Embedded MATLAB tip is to use ‘*1i’ to represent complex numbers. (This is mentioned in the MATLAB documentation but looks like ‘li’.)