Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
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 comentarios
vinod kumar govindu
vinod kumar govindu el 2 de Nov. de 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 el 2 de Nov. de 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()

Iniciar sesión para comentar.

Respuestas (1)

Torsten
Torsten el 24 de Oct. de 2016
Editada: Walter Roberson el 26 de Oct. de 2016

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by