How to combine ezplot and scattered values into one plot?

Hi
I am trying to make a manual linear regression line to fit my measured values. The measured values are plotted with the scatter function and my linear regression line is a symbolic equation. I want my regression line to be plotted together with my measured values. My code:
[k,m,sig] = linearRegression(RSSImean, GPSDistance, valLength)
syms x
figure(1)
for a = 1:(valLength)
scatter(DistanceLog(a), RSSImean(a), 40, 'filled');
hold on
end
hold on
ezplot(k*'x' + m,[DistanceLog(1),DistanceLog(valLength)])
Anyone who knows what I am doing wrong and how it can be solved?
Best regards

Antworten (0)

Gefragt:

am 30 Jun. 2017

Kommentiert:

am 3 Jul. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by