How to plot a kernal function in MATLAB

4 次查看(过去 30 天)
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)

回答(1 个)

Rishita
Rishita 2022-7-15
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

类别

Help CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by