Path: news.mathworks.com!not-for-mail
From: "basalganglia Sch?necker" <thomas.schoenecker@gmx.net>
Newsgroups: comp.soft-sys.matlab
Subject: classify in 3D
Date: Sat, 31 Oct 2009 13:35:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <hchee8$45d$1@fred.mathworks.com>
Reply-To: "basalganglia Sch?necker" <thomas.schoenecker@gmx.net>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1256996104 4269 172.30.248.38 (31 Oct 2009 13:35:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 31 Oct 2009 13:35:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2070035
Xref: news.mathworks.com comp.soft-sys.matlab:581492


Hallo, 

I have data similar to that of the fisheriris data in the classification demo on http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/classdemo.html
The demo is exactly what I want to do with my data. However, I use 3 variables instead of the 2 shown in the demo (3D position in space). The classification works fine but now the problem is how to visualize the classification "line" in 3D when applying the quadratic type of classification. 

In the demo in with 2 variables, the curve is described by the following formula 'f':
K = coeff(1,2).const;
L = coeff(1,2).linear; 
Q = coeff(1,2).quadratic;
f = sprintf('0 = %g+%g*x+%g*y+%g*x^2+%g*x.*y+%g*y.^2',...
            K,L,Q(1,1),Q(1,2)+Q(2,1),Q(2,2));
h2 = ezplot(f,[4.5 8 2 4]);

How would I extend the formula for 3 variables ? It seems that the order of the coefficients provided by classify is not further documented in detail.

Much thanks, Thomas