How do I find the separation between the harmonics for a graph of a function sinx/x against x?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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')
0 Kommentare
Antworten (1)
Paul Hoffrichter
am 12 Jul. 2021
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']
% 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
% . . .
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!