MATLAB: How are math operations of constants in simulink models performed

constantsmath operationsimulation processsimulinksolver

Are the results calculated at every simulation step or are they calculated only once at the beginning of the simulation?
example:
If I have two constants a and b. In Simulink I call them through constant blocks and add them using an add block. Does the solver calculate this sum at each calculation step or does it calculate the sum only once?

Best Answer

Hi Michael,
It depends how you have configured the sample time for your Simulink constant blocks and maths blocks. If they have a sample time of inf then they will only be calculated once. If not they will be calcuated at the sample time assigned.
Regards
Tom