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

2 views (last 30 days)
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 Comments
vinod kumar govindu
vinod kumar govindu on 2 Nov 2016
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 on 2 Nov 2016
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()

Sign in to comment.

Answers (1)

Torsten
Torsten on 24 Oct 2016
Edited: Walter Roberson on 26 Oct 2016

Tags

Community Treasure Hunt

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

Start Hunting!