plotgaus.m

来自「一本关于dsp的原著教材」· M 代码 · 共 25 行

M
25
字号
function [h] = plotgaus( mu, sigma, colspec );% PLOTGAUS Plotting of a Gaussian contour%%    PLOTGAUS(MU,SIGMA,COLSPEC) plots the mean and standard%    deviation ellipsis of the Gaussian process that has mean MU%    variance SIGMA, with color COLSPEC = [R,G,B].%%    If you use only PLOTGAUS(MU,SIGMA), the default color is%    [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 + -
显示快捷键?