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

1 次查看(过去 30 天)
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
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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by