How to execute Discriminant Analysis using Fisher IRIS, without this Error:Structure assignment to non-structure object?
Show older comments
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

Answers (0)
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!