- It sorts symbolic numbers and floating-point numbers numerically.
- It sorts symbolic variables alphabetically.
- In all other cases, including symbolic expressions and functions, sort uses internal sorting rules.
Sort isn't properly sorting symbolic variables even though I am assuming them positive
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have this vector "FrecuenciasCorregidas" with 2 values (both depend on "k" and "m"):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322876/image.png)
I want it to be sorted, so the lower one (3k/20m) goes first and the higher one (k/3m) goes second. So I assume k and m positive and sort:
assume([m,k],'positive');
FrecuenciasCorregidas=sort(FrecuenciasCorregidas,'ascend')
assume([m,k],'clear');
However, I am still getting the same vector:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322879/image.png)
Any idea what am I doing wrong? Thanks
3 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!