I need help with imaginary numbers!
Show older comments
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
Accepted Answer
More Answers (1)
Walter Roberson
on 24 Jun 2016
small_imag_count = sum(imag(YourArray(:)) < 1000);
1 Comment
Walter Roberson
on 25 Jun 2016
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.
Categories
Find more on Logical 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!