How to plot gt please help me ????

9 visualizaciones (últimos 30 días)
yie don
yie don el 7 de Sept. de 2018
Editada: yie don el 9 de Sept. de 2018
syms y(x)
y(x) = piecewise(-0.5<x<0,(2+4*x),0<=x<+0.5,(2-4*x), 0);
figure; %tmin=-6;tmax=6;N=100; want these limits -6<=x<=6
fplot(y);

Respuesta aceptada

Dimitris Kalogiros
Dimitris Kalogiros el 7 de Sept. de 2018
Editada: Dimitris Kalogiros el 7 de Sept. de 2018
clear; clc;
syms t g(x) x(t)
g(t) = piecewise(-0.5<t<0,(2+4*t),0<=t<+0.5,(2-4*t), 0)
x(t)=sym(0);
for k=-6:1:6
x(t)=x(t)+g(t-k);
end
subplot(2,1,1); fplot(g, [-6 6 ]);
grid on; zoom on; ylim([-0.1 2.1])
xlabel('t'); ylabel('g(t)'); title('one period')
subplot(2,1,2); fplot(x, [-6 6 ]);
grid on; zoom on; ylim([-0.1 2.1])
xlabel('t'); ylabel('x(t)'); title('signal x(t)')
...and if you run it:
  6 comentarios
yie don
yie don el 8 de Sept. de 2018
Editada: yie don el 8 de Sept. de 2018
@Dimitris Kalogiros so i have to plot the fourier coefficinets for -101<= k<= +101 for the evaluation of the fourier series can we do it on the same graph with changing the above k limits for new limits or do we have to define a new k value for -t<= t <= 1 ??
Dimitris Kalogiros
Dimitris Kalogiros el 8 de Sept. de 2018
This is my last contribution...
Keep in mind that for your example fourier coefficients are, after all, real numbers and are not zero for add index or 0.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by