real and imaginary part of complex number

50 ビュー (過去 30 日間)
Niclas
Niclas 2019 年 7 月 15 日
コメント済み: Torsten 2019 年 7 月 16 日
Hi,
I'm trying to get the real and imaginary part of a formular in a limited range of a parameter n.
how do I add in my formular
syms n real
imag (1i^n)
that 0 < n < 1 ?
Thanks a lot!
  10 件のコメント
Torsten
Torsten 2019 年 7 月 15 日
r is real - it is the length of the vector from the origin to z.
Thus
real(r^n) = r^n, imag(r^n) = 0.
Niclas
Niclas 2019 年 7 月 16 日
yes, the two solutions are equal.
But how can I use Matlab to transform the equation?
If I give Matlab
imag(1I^n)
as complex number, why the program don't know how to transform it to polar coordinates? And why Matlab don't get from that
imag(r^n) = 0
?
If there any possibility to not do this transformation manually?

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2019 年 7 月 16 日
V = complex(randi([-10 10],1), randi([-10 10])); %some data to work on
syms n real
Vn = V^(1/n);
RV = rewrite( real(Vn), 'exp');
IV = rewrite( imag(Vn), 'exp');
  6 件のコメント
Niclas
Niclas 2019 年 7 月 16 日
Good point Torsten.
I guess we need constrain y further. So why dont take the assumption from begin:
assume(0<y<1)
The Matlab solution stays the same.
Torsten
Torsten 2019 年 7 月 16 日
y positive integer
might work.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by