I am plotting some data from a power-inverse law and using the following:
loglog(E2dist,E2PrdB,'+g'), hold on
p = polyfit(log(E2dist),log(E2PrdB),1);
m = p(1);
b = exp(p(2));
This works fine. But when I change to
[p,S,mu] = polyfit(log(E2dist),log(E2PrdB),1);
my straight line fit is separated vertically from my original data points?
Hope you can help.