example.m
来自「patten regnization source从1-14章能运行」· M 代码 · 共 29 行
M
29 行
clcecho on% An example of the histogram, KDE, and bKDE using a normal distribution%-----------------------------------------------------------------------------------%% produce a sample of 10000 points from a normal distributionx=rand+randn(1,10000);% calculate and plot the histogramhisto(x,0.4,0,'g--'); hold on% calculate and plot KDE using the triangle kernel kde(x,0.4,'ker1','b');% bin the data into 100 bins[xb,cb]=binden(100,x);% calculate and plot BKDE using the triangle kernelbkde(xb,cb,0.4,'ker1','r--'); hold off% Hint: the difference between KDE and bKDE can be increased% by reducing the number of bins used (in 'binden' function)echo off
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?