How can I retrieve the original phase of this complex number in matlab?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Suppose I enter a complex number, say
$$z = -2e^ipi/6$$
And, I have to get the phase of "z" as $[pi/6]$ only. But when I try to retrieve the phase using 'angle(z)' in matlab, it would display the phase as $[(pi/6)-pi]$. I understand the reason behind shift of angle "$pi$" and I don't want this to happen in my original phase. Please help me out on this problem.
complex-numbers matlab
 |Â
show 3 more comments
up vote
1
down vote
favorite
Suppose I enter a complex number, say
$$z = -2e^ipi/6$$
And, I have to get the phase of "z" as $[pi/6]$ only. But when I try to retrieve the phase using 'angle(z)' in matlab, it would display the phase as $[(pi/6)-pi]$. I understand the reason behind shift of angle "$pi$" and I don't want this to happen in my original phase. Please help me out on this problem.
complex-numbers matlab
I believe you mean $2e^i fracpi6$
â Ahmad Bazzi
Jul 20 at 15:35
No, @AhmadBazzi it's -2
â Yatish
Jul 20 at 15:36
How is Matlab supposed to figure out from the number $(-sqrt3-i)$ that you originally specified it as $-2e^ipi/6$ and not as $2e^ipi/6-pi$ or as $2e^ipi/6+pi$?
â celtschk
Jul 20 at 15:40
@celtschk I get your point. What I want is- if I enter negative amplitude, it should store it as negative. On the contrary, matlab converts -1 to exp(ipi) or exp(-ipi). And, I don't want this.
â Yatish
Jul 20 at 15:45
@Yatish: If you need that extra information, you need to store it extra. Because in the number, there's no "space" to store it. Maybe you can store the square root of the number instead; then you can use the fact that a number has two square roots with opposite signs to store the extra sign information.
â celtschk
Jul 20 at 15:53
 |Â
show 3 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Suppose I enter a complex number, say
$$z = -2e^ipi/6$$
And, I have to get the phase of "z" as $[pi/6]$ only. But when I try to retrieve the phase using 'angle(z)' in matlab, it would display the phase as $[(pi/6)-pi]$. I understand the reason behind shift of angle "$pi$" and I don't want this to happen in my original phase. Please help me out on this problem.
complex-numbers matlab
Suppose I enter a complex number, say
$$z = -2e^ipi/6$$
And, I have to get the phase of "z" as $[pi/6]$ only. But when I try to retrieve the phase using 'angle(z)' in matlab, it would display the phase as $[(pi/6)-pi]$. I understand the reason behind shift of angle "$pi$" and I don't want this to happen in my original phase. Please help me out on this problem.
complex-numbers matlab
edited Jul 20 at 15:35
Isham
10.6k3829
10.6k3829
asked Jul 20 at 15:30
Yatish
115
115
I believe you mean $2e^i fracpi6$
â Ahmad Bazzi
Jul 20 at 15:35
No, @AhmadBazzi it's -2
â Yatish
Jul 20 at 15:36
How is Matlab supposed to figure out from the number $(-sqrt3-i)$ that you originally specified it as $-2e^ipi/6$ and not as $2e^ipi/6-pi$ or as $2e^ipi/6+pi$?
â celtschk
Jul 20 at 15:40
@celtschk I get your point. What I want is- if I enter negative amplitude, it should store it as negative. On the contrary, matlab converts -1 to exp(ipi) or exp(-ipi). And, I don't want this.
â Yatish
Jul 20 at 15:45
@Yatish: If you need that extra information, you need to store it extra. Because in the number, there's no "space" to store it. Maybe you can store the square root of the number instead; then you can use the fact that a number has two square roots with opposite signs to store the extra sign information.
â celtschk
Jul 20 at 15:53
 |Â
show 3 more comments
I believe you mean $2e^i fracpi6$
â Ahmad Bazzi
Jul 20 at 15:35
No, @AhmadBazzi it's -2
â Yatish
Jul 20 at 15:36
How is Matlab supposed to figure out from the number $(-sqrt3-i)$ that you originally specified it as $-2e^ipi/6$ and not as $2e^ipi/6-pi$ or as $2e^ipi/6+pi$?
â celtschk
Jul 20 at 15:40
@celtschk I get your point. What I want is- if I enter negative amplitude, it should store it as negative. On the contrary, matlab converts -1 to exp(ipi) or exp(-ipi). And, I don't want this.
â Yatish
Jul 20 at 15:45
@Yatish: If you need that extra information, you need to store it extra. Because in the number, there's no "space" to store it. Maybe you can store the square root of the number instead; then you can use the fact that a number has two square roots with opposite signs to store the extra sign information.
â celtschk
Jul 20 at 15:53
I believe you mean $2e^i fracpi6$
â Ahmad Bazzi
Jul 20 at 15:35
I believe you mean $2e^i fracpi6$
â Ahmad Bazzi
Jul 20 at 15:35
No, @AhmadBazzi it's -2
â Yatish
Jul 20 at 15:36
No, @AhmadBazzi it's -2
â Yatish
Jul 20 at 15:36
How is Matlab supposed to figure out from the number $(-sqrt3-i)$ that you originally specified it as $-2e^ipi/6$ and not as $2e^ipi/6-pi$ or as $2e^ipi/6+pi$?
â celtschk
Jul 20 at 15:40
How is Matlab supposed to figure out from the number $(-sqrt3-i)$ that you originally specified it as $-2e^ipi/6$ and not as $2e^ipi/6-pi$ or as $2e^ipi/6+pi$?
â celtschk
Jul 20 at 15:40
@celtschk I get your point. What I want is- if I enter negative amplitude, it should store it as negative. On the contrary, matlab converts -1 to exp(ipi) or exp(-ipi). And, I don't want this.
â Yatish
Jul 20 at 15:45
@celtschk I get your point. What I want is- if I enter negative amplitude, it should store it as negative. On the contrary, matlab converts -1 to exp(ipi) or exp(-ipi). And, I don't want this.
â Yatish
Jul 20 at 15:45
@Yatish: If you need that extra information, you need to store it extra. Because in the number, there's no "space" to store it. Maybe you can store the square root of the number instead; then you can use the fact that a number has two square roots with opposite signs to store the extra sign information.
â celtschk
Jul 20 at 15:53
@Yatish: If you need that extra information, you need to store it extra. Because in the number, there's no "space" to store it. Maybe you can store the square root of the number instead; then you can use the fact that a number has two square roots with opposite signs to store the extra sign information.
â celtschk
Jul 20 at 15:53
 |Â
show 3 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
The correct polar form representation of a complex number is $z = re^itheta$ where
$r > 0$. Matlab, correctly, interpreted $-2e^i fracpi6$ as
$2e^i frac-5pi6$. If you want to use a nonstandard phase shift, then add $pi$ to any negative phase shifts.
But, what if I want to retrieve the number the way I had entered it? I want the minus sign with 2 instead of being converted to exp(ipi) or exp(-ipi).
â Yatish
Jul 20 at 15:52
In which quadrants do you get the wrong answer? How can you detect that? How can you fix it once you detect it?
â steven gregory
Jul 21 at 0:47
the angle entered in the phase part always lies between -pi and pi. Actually, it doesn't matter in which quadrant does the angle lie in the first place. If matlab finds a negative sign attached with the amplitude, the final angle is going to differ from the entered value by +pi or -pi in order to keep the amplitude positive.
â Yatish
Jul 21 at 13:40
@Yatish - Hint. $e^ipi=-1$, so $re^itheta = -re^i(pi + theta)$
â steven gregory
Jul 21 at 14:51
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The correct polar form representation of a complex number is $z = re^itheta$ where
$r > 0$. Matlab, correctly, interpreted $-2e^i fracpi6$ as
$2e^i frac-5pi6$. If you want to use a nonstandard phase shift, then add $pi$ to any negative phase shifts.
But, what if I want to retrieve the number the way I had entered it? I want the minus sign with 2 instead of being converted to exp(ipi) or exp(-ipi).
â Yatish
Jul 20 at 15:52
In which quadrants do you get the wrong answer? How can you detect that? How can you fix it once you detect it?
â steven gregory
Jul 21 at 0:47
the angle entered in the phase part always lies between -pi and pi. Actually, it doesn't matter in which quadrant does the angle lie in the first place. If matlab finds a negative sign attached with the amplitude, the final angle is going to differ from the entered value by +pi or -pi in order to keep the amplitude positive.
â Yatish
Jul 21 at 13:40
@Yatish - Hint. $e^ipi=-1$, so $re^itheta = -re^i(pi + theta)$
â steven gregory
Jul 21 at 14:51
add a comment |Â
up vote
0
down vote
The correct polar form representation of a complex number is $z = re^itheta$ where
$r > 0$. Matlab, correctly, interpreted $-2e^i fracpi6$ as
$2e^i frac-5pi6$. If you want to use a nonstandard phase shift, then add $pi$ to any negative phase shifts.
But, what if I want to retrieve the number the way I had entered it? I want the minus sign with 2 instead of being converted to exp(ipi) or exp(-ipi).
â Yatish
Jul 20 at 15:52
In which quadrants do you get the wrong answer? How can you detect that? How can you fix it once you detect it?
â steven gregory
Jul 21 at 0:47
the angle entered in the phase part always lies between -pi and pi. Actually, it doesn't matter in which quadrant does the angle lie in the first place. If matlab finds a negative sign attached with the amplitude, the final angle is going to differ from the entered value by +pi or -pi in order to keep the amplitude positive.
â Yatish
Jul 21 at 13:40
@Yatish - Hint. $e^ipi=-1$, so $re^itheta = -re^i(pi + theta)$
â steven gregory
Jul 21 at 14:51
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The correct polar form representation of a complex number is $z = re^itheta$ where
$r > 0$. Matlab, correctly, interpreted $-2e^i fracpi6$ as
$2e^i frac-5pi6$. If you want to use a nonstandard phase shift, then add $pi$ to any negative phase shifts.
The correct polar form representation of a complex number is $z = re^itheta$ where
$r > 0$. Matlab, correctly, interpreted $-2e^i fracpi6$ as
$2e^i frac-5pi6$. If you want to use a nonstandard phase shift, then add $pi$ to any negative phase shifts.
answered Jul 20 at 15:49
steven gregory
16.4k22055
16.4k22055
But, what if I want to retrieve the number the way I had entered it? I want the minus sign with 2 instead of being converted to exp(ipi) or exp(-ipi).
â Yatish
Jul 20 at 15:52
In which quadrants do you get the wrong answer? How can you detect that? How can you fix it once you detect it?
â steven gregory
Jul 21 at 0:47
the angle entered in the phase part always lies between -pi and pi. Actually, it doesn't matter in which quadrant does the angle lie in the first place. If matlab finds a negative sign attached with the amplitude, the final angle is going to differ from the entered value by +pi or -pi in order to keep the amplitude positive.
â Yatish
Jul 21 at 13:40
@Yatish - Hint. $e^ipi=-1$, so $re^itheta = -re^i(pi + theta)$
â steven gregory
Jul 21 at 14:51
add a comment |Â
But, what if I want to retrieve the number the way I had entered it? I want the minus sign with 2 instead of being converted to exp(ipi) or exp(-ipi).
â Yatish
Jul 20 at 15:52
In which quadrants do you get the wrong answer? How can you detect that? How can you fix it once you detect it?
â steven gregory
Jul 21 at 0:47
the angle entered in the phase part always lies between -pi and pi. Actually, it doesn't matter in which quadrant does the angle lie in the first place. If matlab finds a negative sign attached with the amplitude, the final angle is going to differ from the entered value by +pi or -pi in order to keep the amplitude positive.
â Yatish
Jul 21 at 13:40
@Yatish - Hint. $e^ipi=-1$, so $re^itheta = -re^i(pi + theta)$
â steven gregory
Jul 21 at 14:51
But, what if I want to retrieve the number the way I had entered it? I want the minus sign with 2 instead of being converted to exp(ipi) or exp(-ipi).
â Yatish
Jul 20 at 15:52
But, what if I want to retrieve the number the way I had entered it? I want the minus sign with 2 instead of being converted to exp(ipi) or exp(-ipi).
â Yatish
Jul 20 at 15:52
In which quadrants do you get the wrong answer? How can you detect that? How can you fix it once you detect it?
â steven gregory
Jul 21 at 0:47
In which quadrants do you get the wrong answer? How can you detect that? How can you fix it once you detect it?
â steven gregory
Jul 21 at 0:47
the angle entered in the phase part always lies between -pi and pi. Actually, it doesn't matter in which quadrant does the angle lie in the first place. If matlab finds a negative sign attached with the amplitude, the final angle is going to differ from the entered value by +pi or -pi in order to keep the amplitude positive.
â Yatish
Jul 21 at 13:40
the angle entered in the phase part always lies between -pi and pi. Actually, it doesn't matter in which quadrant does the angle lie in the first place. If matlab finds a negative sign attached with the amplitude, the final angle is going to differ from the entered value by +pi or -pi in order to keep the amplitude positive.
â Yatish
Jul 21 at 13:40
@Yatish - Hint. $e^ipi=-1$, so $re^itheta = -re^i(pi + theta)$
â steven gregory
Jul 21 at 14:51
@Yatish - Hint. $e^ipi=-1$, so $re^itheta = -re^i(pi + theta)$
â steven gregory
Jul 21 at 14:51
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2857762%2fhow-can-i-retrieve-the-original-phase-of-this-complex-number-in-matlab%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I believe you mean $2e^i fracpi6$
â Ahmad Bazzi
Jul 20 at 15:35
No, @AhmadBazzi it's -2
â Yatish
Jul 20 at 15:36
How is Matlab supposed to figure out from the number $(-sqrt3-i)$ that you originally specified it as $-2e^ipi/6$ and not as $2e^ipi/6-pi$ or as $2e^ipi/6+pi$?
â celtschk
Jul 20 at 15:40
@celtschk I get your point. What I want is- if I enter negative amplitude, it should store it as negative. On the contrary, matlab converts -1 to exp(ipi) or exp(-ipi). And, I don't want this.
â Yatish
Jul 20 at 15:45
@Yatish: If you need that extra information, you need to store it extra. Because in the number, there's no "space" to store it. Maybe you can store the square root of the number instead; then you can use the fact that a number has two square roots with opposite signs to store the extra sign information.
â celtschk
Jul 20 at 15:53