フィルターのクリア

How do I find the separation between the harmonics for a graph of a function sinx/x against x?

4 ビュー (過去 30 日間)
Salreem
Salreem 2021 年 7 月 11 日
回答済み: Paul Hoffrichter 2021 年 7 月 12 日
I have used the following code to plot
x=linspace(-90,90,10000);
y=sin(x)./x;
plot(x,y);
axis([-90 90 -1.5 1.5])
xlabel('x')
ylabel('y')
title('A GRAPH OF A FUNCTION Y=(SINX)/X AGAINST X')

回答 (1 件)

Paul Hoffrichter
Paul Hoffrichter 2021 年 7 月 12 日
Not sure if thisis what you are looking for.
x=linspace(-90,90,10000);
y=sin(x)./x;
figure(11)
plot(x,y);
axis([-90 90 -1.5 1.5])
xlabel('x')
ylabel('y')
title('A GRAPH OF A FUNCTION Y=(SINX)/X AGAINST X')
figure(12)
findpeaks(y,x);
[pks,locs] = findpeaks(y,x);
[pks' locs']
ans = 29×2
0.0112 -89.5320 0.0120 -83.2313 0.0130 -76.9487 0.0141 -70.6661 0.0155 -64.3834 0.0172 -58.1008 0.0193 -51.8182 0.0220 -45.5356 0.0255 -39.2529 0.0303 -32.9523
% 0.0375 -26.6697
% 0.0490 -20.3690
% 0.0709 -14.0684
% 0.1284 -7.7318
% 1.0000 -0.0090
% 0.1284 7.7318
% 0.0709 14.0684
% 0.0490 20.3690
% 0.0375 26.6697
% . . .

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by