help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sortcom


From: Urs Hackstein
Subject: sortcom
Date: Mon, 22 Apr 2013 17:23:43 +0200


Dear list,

let x be a vector of complex numbers. I want to sort these complex numbers by its real parts, i.e. as -2+32*i, -1+3*i,2+30*i, .... for example.
sort(x) however sorts complex numbers by its absolute value and sort(real(x)) gives -2,-1,1,... I found a program called sortcom online http://lasp.colorado.edu/cism/CISM_DX/code/CISM_DX-0.50/required_packages/octave/share/octave/2.1.50/m/control/util/sortcom.m which claims to do the desired issue.
However, I still receive two errors if I try to run it:
In line 74, it callsĀ  create_set what is deprecated and can be changed to unique.
In line 75, I receive the following error:
error: sortcom: mx_el_eq: nonconformant arguments (op1 is 7x1, op2 is 2x1)
Can these errors be fixed or is there another way to sort the vector in the desired way?
Thanks a lot in advance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]