How to sort an array efficiently in Simulink?

52 Ansichten (letzte 30 Tage)
Rukmani Mohanganesh
Rukmani Mohanganesh am 3 Jul. 2013
I am trying to sort a given array in ascending order using Simulink blocks. Is there any block available which does this. If no, how could this be done efficiently in Simulink?

Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 3 Jul. 2013
If you have a license to the DSP System Toolbox, you can use the Sort block. Otherwise, use the MATLAB Function block to call the MATLAB sort function. I don't know enough about either implementation to comment on their efficiency.

Weitere Antworten (1)

Kirankumar Bacchewar
Kirankumar Bacchewar am 15 Okt. 2021
Even the sort function from Matlab is not effecient, I see lot of overhead. In my case, the execution time reduced drastically after modifying(partial re-using) the generated code from Matlab sort in simulink. This modified code was then included back into the model as legacy code.

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by