How to sort an array efficiently in Simulink?

조회 수: 56 (최근 30일)
Rukmani Mohanganesh
Rukmani Mohanganesh 2013년 7월 3일
답변: Kirankumar Bacchewar 2021년 10월 15일
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?

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 7월 3일
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.

추가 답변 (1개)

Kirankumar Bacchewar
Kirankumar Bacchewar 2021년 10월 15일
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.

카테고리

Help CenterFile Exchange에서 Signal Generation에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by