I am trying to plot this
4 ビュー (過去 30 日間)
古いコメントを表示
How do i code and plot using odd harmonic of fundamental frequencies??![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1175758/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1175758/image.png)
0 件のコメント
回答 (1 件)
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.
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!