max and min complex number

조회 수: 115(최근 30일)
ElizabethR
ElizabethR 2016년 6월 7일
댓글: ElizabethR 2016년 6월 14일
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

채택된 답변

Guillaume
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.
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
ElizabethR
ElizabethR 2016년 6월 14일
yes, thanks for your explanation. Now i am understand about complex number. thank you so much Guillaume.

댓글을 달려면 로그인하십시오.

추가 답변(2개)

Azzi Abdelmalek
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
ElizabethR
ElizabethR 2016년 6월 14일
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

댓글을 달려면 로그인하십시오.


Iain
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
ElizabethR
ElizabethR 2016년 6월 14일
편집: ElizabethR 2016년 6월 14일
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

댓글을 달려면 로그인하십시오.

범주

Find more on Descriptive Statistics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by