Skip to main content
23-Emerald V
September 23, 2025
Question

Sorting Complex Numbers

  • September 23, 2025
  • 1 reply
  • 596 views

Reference https://community.ptc.com/t5/Mathcad/Sum-in-Mathcad-Prime/m-p/1035397/highlight/true#M218879

 

Following on from the discussion re minima and maxima of various Mathcad data types, I gave up on trying to fault-find my original (messy) complex sort worksheet, and present the following simplified Mathcad Prime 11 version for your edification.  It's based on merge sort.

 

2025 09 23 H.png

 

zv is the complex-valued vector to sort, and I've rerun the results in MATLAB.

.

Stuart  

1 reply

25-Diamond I
September 23, 2025

What am I missing?

Werner_E_1-1758667709640.png

 

 

25-Diamond I
September 24, 2025

A quick hack to fix the problem with 1-column matrices:

Werner_E_1-1758692285018.png

Werner_E_4-1758692767567.png

23-Emerald V
September 24, 2025

Yes, effectively the same solution.   Great minds ... ðŸ˜ˆ

 

Then I realised that, in terms of testing, I'm busy doing all the barking when I've got a perfectly good laptop that can do that for me:

 

2025 09 24 C.png

 

Stuart