필터 지우기
필터 지우기

I need help with imaginary numbers!

조회 수: 8 (최근 30일)
Julian Epps
Julian Epps 2016년 6월 24일
댓글: Walter Roberson 2016년 6월 25일
How can I count the amount of numbers for which and imaginary number is less than lets say 1000.
For example display the number of negative integers for which i^(1.7) is less than 1000. I know this may not be much to go off of but that's all I have and I have no idea how to approach this problem. I'd appreciate any help

채택된 답변

Roger Stafford
Roger Stafford 2016년 6월 25일
편집: Roger Stafford 2016년 6월 25일
You should understand that matlab’s “<“ operator only tests the real part of a complex number. For a pure imaginary number it would be treated as if it were zero, since the real part would be zero in this case.
Think of complex numbers as points in the infinite two-dimensional plane, with the real numbers along the x-axis and the pure imaginary numbers along the y-axis. Adding complex numbers is the same as adding the two vectors by the parallelogram law that point from the origin to the two points. Multiplying them is multiplying their magnitudes (lengths) and then adding their angles measured counterclockwise from the real line (x-axis.) That means that you have:
(a+b*i) + (c+d*i) = (a+c) + (b+d)*i
(a+b*i) * (c+d*i) = (a*c-b*d) + (a*d+b*c)*i
You can see that the concept of less than is somewhat vague as applied to complex numbers since you are asking which of two points in the plane is less than the other. Does it mean closer to the origin, further to the left, or below? All of these would be possible meanings. You have to decide which you mean and then apply matlab accordingly.
The concept of taking a complex number to an integer power is that of multiplying its angle with respect to the real line by the factor of that power and expanding its magnitude by a factor of this same power. Taking its n-th root is a matter of finding a complex number which can be taken to the n-th power and achieving the given complex number. You will find that this latter is not unique, since there will always be n different way of accomplishing that.
As far as i^(1.7) is concerned you can think of it as (i^10)^(1/17), and accordingly it has seventeen different possible results. Matlab will give you only one of these.
That’s enough about complex number theory. It’s a very large topic in mathematics.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2016년 6월 24일
small_imag_count = sum(imag(YourArray(:)) < 1000);
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 6월 25일
You can convert x^y to exponential form. In the particular case of y > 0 and x < 0, it becomes
exp(y*ln(-x))*cos(y*Pi) + 1i * exp(y*ln(-x))*sin(y*Pi)
you can then take the real or imaginary portions, which would be
exp(y*ln(-x))*cos(y*Pi)
or
exp(y*ln(-x))*sin(y*Pi)
for the imaginary part.
You can substitute in the 1.7 for y, and then solve what comes out for equality to 1000. Though if you do that for the imaginary part you will find no solutions -- for negative x, the imaginary part of x^1.7 is negative.

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

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by