Hi,
You can utilize the following blocks:
Using these simulink blocks, you can define the required function.
If there is some issue while using these blocks
- You can create a function using stateflow chart
Refer this link for documentation of method described above. The document also illustrates how to use ‘Simulink function’ block.
Hope this helps.