t=linspace(0,100000000000,10000000);
y=0.1366*exp(-1j*30.171*(10^-11)*t);
plot(t,y)
for this graph i am getting -ve values ,i want to plot |y|, how to achieve this

 채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2020년 9월 20일

0 개 추천

plot(t,abs(y))
HTH

댓글 수: 2

ajay teja
ajay teja 2020년 9월 20일
no, if i do that its giving straight line,
Walter Roberson
Walter Roberson 2020년 9월 20일
Correct, abs() of that is a straight line.
exp(1j*A*t) can be rewritten in terms of sin and cos as cos(A*t) + 1j*sin(A*t) .
Under the assumption that A and t are both real-valued, we can see that this is a complex number. P+Q*1i with P and Q real. abs(P+Q*1i) is sqrt(P^2 + Q^2) .
So, abs(exp(1j*A*t) is abs(cos(A*t) + 1j*sin(A*t)) which is sqrt(cos(A*t)^2 + sin(A*t)^2) . But sin^2(x) + cos^2(x) = 1. So under the assumption that A and t are real valued, then abs(exp(1j*A*t) is sqrt(1) = 1.
The 30.171*(10^-11) would wash away, leaving you with just abs(0.1366), and the plot of that is a straight line.

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

추가 답변 (0개)

카테고리

제품

릴리스

R2020a

태그

질문:

2020년 9월 20일

댓글:

2020년 9월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by