Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
だから私は複雑な値を含むベクトルを持っています。架空の昇順で並べ替えたいと思います。これを行う方法はありますか?
並べ替えのドキュメントによると、sort大きさによって並べ替えられます。
sort
ありがとう
次のようなことを試してください:
a = [1 + 1i; 1 - 1i; 1 - 2*1i]; [sorted, idx] = sort(imag(a)); a = a(idx); a = 1.0000 - 2.0000i 1.0000 - 1.0000i 1.0000 + 1.0000i