How to plot a kernal function in MATLAB

4 Ansichten (letzte 30 Tage)
Hamza Khan
Hamza Khan am 14 Jul. 2022
Beantwortet: Rishita am 15 Jul. 2022
Unsure what I'm doing wrong here. May be the mathematical operation. Also unsure how to see what happens when the kernal = 0. Attached is the function given and the plot obtained from MATLAB code. Below is my current MATLAB code and plot.
% Evaluating kernal functions, kernal 2
Fs = 33600;
n = 0:Fs;
a = floor(n-(Fs/2));
c = (1200*pi)/Fs; % c is greek letter chi
g = pi/Fs; % g is greek symbol gamma
k2 = sin(n*c)-10*sin(9*n*c);
plot(n,k2)

Antworten (1)

Rishita
Rishita am 15 Jul. 2022
SixMPG = [13;15;23;29;32;34];
figure
histogram(SixMPG)
figure
pdSix = fitdist(SixMPG,'Kernel','Width',4);
x = 0:.1:45;
ySix = pdf(pdSix,x);
plot(x,ySix,'k-','LineWidth',2)
% Plot each individual pdf and scale its appearance on the plot
hold on
for i=1:6
pd = makedist('Normal','mu',SixMPG(i),'sigma',4);
y = pdf(pd,x);
y = y/6;
plot(x,y,'b:')
end
hold off

Kategorien

Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by