max and min complex number
91 次查看(过去 30 天)
显示 更早的评论
i have set that contain complex number, then i get the greatest value using max function and get the smallest value using min function. For example the max value is -0.0115230+0.0474206i and the minimum value is 0.0026796 + 0.0006868i But if i give this command -0.0115230+0.0474206i > 0.0026796 + 0.0006868i it get the result ans=0. So, how did it happen ? should the result is ans=1 ?? please help. i am very confused
0 个评论
采纳的回答
Guillaume
2016-6-7
It can be proven that complex numbers cannot be ordered (under the definition of an ordered field). That means that you cannot compare complex numbers.
5 个评论
Guillaume
2016-6-14
Complex numbers are the same as points on a 2D plane. Given a set of points in a plane, can you tell which is the minimum and which is the maximum? No, the concept does not make sense. Same for complex numbers.
Similarly, given a set of points, can you tell if another point is in the range of these points? Well, first you have to define what you mean by the range of a set of points. Until you do that, we can't help you.
Possibly, you can define a point in range of a set of point if it is within the convex hull of the set, but only you can decide that.
更多回答(2 个)
Azzi Abdelmalek
2016-6-7
编辑:Azzi Abdelmalek
2016-6-7
If x1=1.1+2*i and x2=1+2.1*i What is the smallest number ? You can't compare two complex numbers, you can compare their modulus
abs(x1)>abs(x2)
I think max and min function, in your case, are finding the max and min of abs(your_array)
9 个评论
Guillaume
2016-6-9
"If you wish to create an order then you can use the magnitude."
You can, but that ordering is not compatible with addition and multiplication. So, with that ordering, if you have
z1 < z2
You cannot assume that
z1 + c < z2 + c %c a complex constant
z1 * c < z2 * c, with c > 0 a complex constant
Iain
2016-6-7
Max is calculating the absolute value, and then taking the maximum value, despite being negative.
Greater than is taking the value farthest from negative infinity.
7 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!