?? pbayescln.m
字號(hào):
function pbayescln(MI,SIGMA,Pk,background, linestyle)% PBAYESCLN vizualizes Bayes classifier discriminant in 2D.% pbayescln(MI,SIGMA,Pk,background, linestyle )%% This fucntion vizualizes discriminant functions of % Bayes classifier (see help bayescln). %% Intput:% (notation: K - number of classes)% MI [2xK] Matrix of K vectors of mean values of p(x|k).% MI=[mi_1,mi_2,...,mi_K], where mi_j is a column vector [Nx1] for % class j.% SIGMA [(2x2)xK] Matrix of covariance matrices of the density p(x|k).% SIGMA=[sigma_1,sigma_2,...,sigma_K], sigma_j is the covariance% matrix corresponding to the class j.% Pk [1xK] Vector with a priori probability densities. Pk(j) is an% a priori probability of class j.% background [1x1] if is 0 then only the border (discriminat fce = 0) % is displayed. If is 1 (default) then the colors of background % correspond to values of discriminant function. % linestyle [string] used line style (see help plot).%% Output:% Graph to current figure.% % See also BAYESCLN, PDISCRIM.% % Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz% Written Vojtech Franc (diploma thesis) 23.12.1999, 5.4.2000% Modifications% 20-may-2001, V. Franc, createdif nargin < 4 | isempty(background), background = 1;endif nargin < 5, linestyle = 'k';end% gridGRIDX=50;GRIDY=50;if nargin < 3, error('Not enough input arguments.'); return;endV = axis;dx = (V(2)-V(1))/GRIDX;dy = (V(4)-V(3))/GRIDY;[X,Y] = meshgrid(V(1):dx:V(2),V(3):dy:V(4));% make testing pointsXtst=[reshape(X',1,prod(size(X)));reshape(Y',1,prod(size(Y)))];% classify points[Ixy, D] = bayescln(Xtst,MI,SIGMA,Pk);pdiscrim( D, V(1):dx:V(2), V(3):dy:V(4), background, linestyle );axis(V);return;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -