plotgaus.m
来自「patten regnization source从1-14章能运行」· M 代码 · 共 25 行
M
25 行
function [h] = plotgaus( mu, sigma, colspec );
% PLOTGAUS 啊快矫救 牧捧绢 弊妨焊扁
%
% PLOTGAUS(MU,SIGMA,COLSPEC)
% MU : 乞闭
% SIGMA : 傍盒魂
% 祸彬瘤沥牢磊 COLSPEC = [R,G,B].
% PLOTGAUS(MU,SIGMA)老 版快, 叼弃飘 祸惑篮 [0 1 1] (cyan).
%
if nargin < 3; colspec = [0 1 1]; end;
npts = 100;
stdev = sqrtm(sigma);
t = linspace(-pi, pi, npts);
t=t(:);
X = [cos(t) sin(t)] * stdev + repmat(mu,npts,1);
h(1) = line(X(:,1),X(:,2),'color',colspec,'linew',2);
h(2) = line(mu(1),mu(2),'marker','+','markersize',10,'color',colspec,'linew',2);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?