Borrar filtros
Borrar filtros

I am trying to plot this

4 visualizaciones (últimos 30 días)
Ye
Ye el 1 de Nov. de 2022
Respondida: Star Strider el 1 de Nov. de 2022
How do i code and plot using odd harmonic of fundamental frequencies??

Respuestas (1)

Star Strider
Star Strider el 1 de Nov. de 2022
Try this —
t = linspace(0, 2*pi, 1E3); % Time Vector
x = 1:2:31; % Terms Vector
f = 2; % Frequency
s = sum(sin(x(:)*t*f)./x(:)); % Signal
figure
plot(t,s)
grid
xlabel('t')
ylabel('s')
xlim([min(t) max(t)])
I will let you figure out how it works.
.

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by