can anybody tell the matlab code for summation of multiple numbers?

조회 수: 2 (최근 30일)
vinod kumar govindu
vinod kumar govindu 2016년 10월 24일
댓글: Walter Roberson 2016년 11월 2일
N=200
Rx1 contains amplitude ai1,phase bi1(where 1<=i<=N)
Rx2 contains amplitude ai2,phase bi2(where 1<=i<=N)
Rx3 contains amplitude ai3,phase bi3(where 1<=i<=N) then
I=summation(ai1cosbi1)(here i lies 1 to N)
Q=summation(ai1sinbi1)(here i lies 1 to N)
finally
G=I+jQ(j is imaginary)
  댓글 수: 5
vinod kumar govindu
vinod kumar govindu 2016년 11월 2일
i want to plot complex signal
R1=RR1+RR2+RR3;
I1=IR1+IR2+IR3;
t=(0:1:100);
J=sqrt(-1);
complexreturn=R1+J*I1;
Re=real(complexreturn);
Im=imag(complexreturn);
plot(Re,Im,t,complexreturn);
grid on;
xlabel('time');
ylabel('amplitude');
title('time series');
after doing this it showing error
Warning: Imaginary parts of complex X and/or Y arguments ignored > In G at 114
help me to solve this?
Walter Roberson
Walter Roberson 2016년 11월 2일
You have
plot(Re,Im,t,complexreturn);
which is equivalent to two plots combined
plot(Re,Im)
plot(t,complexreturn)
Re and Im are both real-valued so that part of the plot would be okay.
t is real-valued so that part is okay.
complexreturn was constructed as complexreturn=R1+J*I1; where J = sqrt(-1) . So complexreturn is complex. You cannot plot complex data, only the real or imaginary portions or the abs() value, or the angle()

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

답변 (1개)

Torsten
Torsten 2016년 10월 24일
편집: Walter Roberson 2016년 10월 26일

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by