Logarithmic best-fit line
58 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jonathan Moorman
am 10 Dez. 2020
Kommentiert: Walter Roberson
am 10 Dez. 2020
Hi all,
I have two vectors x and y, and I need to add a logarithmic best-fit line to the graph. This is a pretty easy feature to add on excel, but I am having trouble doing it in Matlab. Could someone please write some script using the two vectors on how to accomplish this? (Also, please no links. I tried to follow other Mathworks answers, but I still am not understanding this. Thanks!
Below is what the best fit line looks like on Excel (for reference to what I am asking)
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 10 Dez. 2020
No. You have negative y data, and logarithmic fit of that would go complex valued.
If you only want the x to be logarithmic, then either use semilogx() or else plot in your normal way and the set the XScale property of the axes to 'log'
3 Kommentare
Walter Roberson
am 10 Dez. 2020
When I search around, I do not find the possibility of there being a linear shift in anything called a "logarithmic fit". I only find that the log space might have a linear shift -- which corresponds to a multiplicative constant in linear space.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!