MATLAB: Stateflow: Output appears after some time/steps for a function call

stateflow

I am using stateflow diagrams for a model and it is having multiple statecharts. The statecharts are having graphical functions and it is available globally. In one of the graphical functions, an output variable is changing. When I call this function, the output is changing after few seconds of time of execution. Example of function:
function StateSampleFunc(InputVar)
OutVariable = InputVar; %Weitten on transition
The InputVar is visible on the OutVariable after few seconds of calling the function StateSampleFunc.Is this expected for a bigger models having multiple statecharts and outputs?

Best Answer

The issue was with the sampling time used was different with the chart which is calling the function and the chart containing the function.