How I can separate the data points by line?
6 views (last 30 days)
Show older comments

1 Comment
Accepted Answer
Matt J
on 3 Jul 2022
Edited: Matt J
on 3 Jul 2022
%synthetic data
N=500;
Resistivity=rand(N,1);
Porosity=rand(N,1);
Saturation=vecnorm([Porosity,Resistivity],2,2);
%classify
labels=Saturation<0.2;
mdl=fitclinear([Porosity,Resistivity],labels);
%plot
scatter(Porosity,Resistivity,50, Saturation,'filled'); colormap cool; colorbar
ax=axis;
hold on;
fimplicit(@(x,y)x*mdl.Beta(1)+y*mdl.Beta(2)-mdl.Bias,'LineWidth',3,'Color','k');
hold off
axis(ax*1.2-0.1)
0 Comments
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!