Unfortunately it is not possible to call a client port directly from a Stateflow chart or a MATLAB Function block.
As a workaround for MATLAB Function blocks, you may use one of the following:
1) Call the client port directly from the MATLAB Function block using "coder.ceval" with the RTE function name in C (i.e. "Rte_Call_..."):
2) Create a Simulink function in the model, and place a function caller block inside of the Simulink function (which is mapped to the client port). Then call the Simulink function directly from MATLAB Function block. Note that this will result in an extra function wrapping around the call to the client port in the generated code.
As a workaround for Stateflow charts, you may use one of the following:
1) Call the client port directly from a Stateflow transition by using the C action language and specifying the RTE function name in C (i.e. "Rte_Call_..."). Note that you will not be able to simulate this model unless you provide the necessary header and source files in the Simulation Target settings:
2) Create a Simulink function in the model, and place a function caller block inside of the Simulink function (which is mapped to the client port). Then call the Simulink function directly from a Stateflow transition. Note that this will result in an extra function wrapping around the call to the client port in the generated code.
3) Create a Simulink function inside the Stateflow chart, and place a function caller block inside of this Simulink function (which is mapped to the client port). Then call the Simulink function directly from a Stateflow transition. This approach, as compared to #2, has the ability to inline the call to the client port in the generated code.