How to execute Discriminant Analysis using Fisher IRIS, without this Error:Structure assignment to non-structure object?

I'm trying to execute this piece of code of Discriminant Analysis in MATLAB, I'm getting the figure but also getting the error called "Structure assignment to non-structure object" "h1(1).LineWidth = 2;". How to execute without this error? Source: https://in.mathworks.com/help/stats/discriminant-analysis.html#brah8i8-1
load fisheriris
PL = meas(:,3); %petal length (third column in meas )
PW = meas(:,4); %petal width (fourth column in meas )
h1 = gscatter(PL,PW,species,'krb','ov^',[],'off');
h1(1).LineWidth = 2;
h1(2).LineWidth = 2;
h1(3).LineWidth = 2;
legend('Setosa','Versicolor','Virginica','Location','best')
hold on

Respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 8 de Dic. de 2016

Editada:

el 8 de Dic. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by