Linear regression in x log plot matlab

1 view (last 30 days)
Reto Kurz
Reto Kurz on 11 Jul 2022
Hey,
I would like to show the linear regression (straight line) of this data with the x-axis in log . So far I only get a mossy line.
Can I ask for a little help?
y = [156.547 173.256 126.514 131.344 158.640 105.313 132.794 134.500 130.340 126.969 91.931 107 104 75.717 85 65.500 145];
x = [36000 21000 18300 61300 53000 65000 37000 160000 470000 43000 93000 160000 82000 214000 120000 160000 40000]
x = 1×17
36000 21000 18300 61300 53000 65000 37000 160000 470000 43000 93000 160000 82000 214000 120000 160000 40000
mdl = fitlm(x,y);
hold on
plot(mdl)
set(gca, 'XScale', 'log')

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by