Info

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

Robustfit will not it to data on graph

2 views (last 30 days)
cvbnm
cvbnm on 19 Nov 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
Why wont the robustfit fit to my data points? The data plots are obviously showing most along the y-direction (attached file). My code is as follows:
mask = (x > 0) & (y > 0.004);
[b,stats]=robustfit(x(mask),y(mask));
x1=[min(x(mask)),max(x(mask))];
y1= b(1)+b(2)*x1;
hold on
plot(x(mask),y(mask),'.b');
plot(x1,y1,'-r');

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!