Info

This question is closed. Reopen it to edit or answer.

Differences in terms of computation time when running two codes in Matlab and in Simulink

1 view (last 30 days)
Hi !
I have two models written in Matlab to simulate both the aerodynamic and propeller subsystem in a flight simulator.
The computation times required to run 50 evaluation of each model isolated in MATLAB are the following:
  • Propeller -> 0.531s
  • Aerodynamic -> 7.231s
As I expected, the Aerodynamic subsystem is more demanding.
In the Simulink model, I have a Matlab Function Block inside which it is called all the subsystems, included the Propeller and Aerodynamic models. Measuring the time spent inside this block to compute each model, it turns out that now, I don’t know why, the propeller is much slower than the aerodynamic. In terms of percentage, the computation time distribution of this Matlab Function Block is the following:
  • Propeller -> 90%
  • Aerodynamic –> 8%
  • Rest of the subsystems –> 2%
What could be the cause of this behavior?
Thank you very much. I will appreciate your answers

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!