MATLAB Answers

max and min complex number

조회 수: 100(최근 30일)
ElizabethR
ElizabethR 7 Jun 2016
댓글: ElizabethR 14 Jun 2016
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

Sign in to comment.

채택된 답변

Guillaume
Guillaume 7 Jun 2016
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.
As per the documentation, < (and co.) only compare the real part of a number, whereas min returns the complex number with the smallest magnitude.

  댓글 수: 5

표시 이전 댓글 수: 2
ElizabethR
ElizabethR 8 Jun 2016
thanks for answare Guilaume.. Thanks for your explanation. if you say there is no ordering in complex number, so what should i do ? the set of complex number that i have is represent value of feature extraction of an image. So, if there is new image with new feature extraction, will be chacked whether the result of the feature extraction is in the range of the set of feature extraction or not. so how to make it ? i am really dizzy.
Guillaume
Guillaume 14 Jun 2016
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.
ElizabethR
ElizabethR 14 Jun 2016
yes, thanks for your explanation. Now i am understand about complex number. thank you so much Guillaume.

Sign in to comment.

추가 답변(2개)

Azzi Abdelmalek
Azzi Abdelmalek 7 Jun 2016
편집: Azzi Abdelmalek 7 Jun 2016
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

표시 이전 댓글 수: 6
ElizabethR
ElizabethR 9 Jun 2016
@stephen, yes.. thank you
Guillaume
Guillaume 9 Jun 2016
"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
ElizabethR
ElizabethR 14 Jun 2016
hi Guillaume, thank you so much for your answare and explanation. Yes, now i am understand. Thank you. May i ask once again ? whether you have reference ( ebook ) about complex number ? so i can make strong argument in my task about complex number. God Bless You. sorry for my bad english

Sign in to comment.


Iain
Iain 7 Jun 2016
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

표시 이전 댓글 수: 4
ElizabethR
ElizabethR 8 Jun 2016
@Guillaume yes thanks.
Torsten
Torsten 9 Jun 2016
@eliz, I asked because your question had already been answered several times and it seemed to me you were not satisfied with these responses. So my guess was that you tried to ask something different, something we did not yet understand.
Best wishes
Torsten.
ElizabethR
ElizabethR 14 Jun 2016
hi Torsten. oohhh I am Sorry, May be it became misunderstand, it not mean i am not satisfied with the answare, but, i confused so i ask again. But thank you so much. May i ask once again ? whether you have reference ( ebook ) about complex number ? so i can make strong argument in my task about complex number. God Bless You. sorry for my bad english

Sign in to comment.


Translated by