Info

This question is closed. Reopen it to edit or answer.

How can I create a quadric surface which separates two groups of data in three dimensions.

1 view (last 30 days)
How can I plot a quadric surface which separates two groups in the fisher iris dataset based on the first three variables (sepal length, sepal width, and petal length)? I have used the following code to plot and obtain the boundary coefficients.
load fisheriris
figure()
%plot data
scatter3(meas(1:50,1),meas(1:50,2),meas(1:50,3),30,'filled','MarkerEdgeColor','black','MarkerFaceColor','r','LineWidth',0.3);
hold on
scatter3(meas(51:100,1),meas(51:100,2),meas(51:100,3),30,'filled','MarkerEdgeColor','black','MarkerFaceColor','g','LineWidth',0.3);
%perform discriminant analysis
cqs = fitcdiscr(meas(1:100,1:3),species(1:100,1),'DiscrimType','quadratic');
%Decision boundary coefficients
Const = cqs.Coeffs(1,2).Const
Linear = cqs.Coeffs(1,2).Linear
Quadratic = cqs.Coeffs(1,2).Quadratic

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!