I am trying to plot this

4 次查看(过去 30 天)
Ye
Ye 2022-11-1
How do i code and plot using odd harmonic of fundamental frequencies??

回答(1 个)

Star Strider
Star Strider 2022-11-1
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.
.

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by