pquad2d.m

来自「this a SVM toolbox,it is very useful for」· M 代码 · 共 58 行

M
58
字号
function []=pquad2d(A,B,C,plotargs,win,interp)% PQUAD2D plots contour of quadratic function in 2D.%  pquad2d(A,B,C,plotargs,win,interp)%% PQUAD2D plots quadratic function in 2D space which is %   defined as%      x'*A*x + B'*x + C = 0,%%   where A is matrix [2x2], B is vector [2x1] and C is real [1x1].%%   The argument plotargs has the same meaning as in Matlab function plot.%   The function domain can be restricted by argument %   win=[xmin xmax ymin ymax], default values are taken from current%   axes. The quadratic function is interpolated by lines and their %   number can be controled by the argument interp. %   % Input:%   A [2x2], B [2x1], C [1x1] coefficients of quadratic function%   plotargs [string]  see help plot.%   win [1x4] function domain, i.e. win=[xmin xmax ymin ymax]%   interp [1x1] number of lines used for interpolation.%% See also L2Q2D.%  % Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz% Written Vojtech Franc (diploma thesis) 19.11.1999% Modifications% 26-June-2001, V.Franc, comments repared.% 24. 6.00 V. Hlavac, comments polished.if nargin < 4,  plotargs = '';endif nargin < 5,  win = axis;endif nargin < 6,  [x1,y1,x2,y2]=quad2d(A,B,C,win);else  [x1,y1,x2,y2]=quad2d(A,B,C,win,interp);endhold on;if length(x1) ~= 0,  plot(x1,y1,plotargs);endif length(x2) ~= 0,  plot(x2,y2,plotargs);end  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?