define function to data set
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ignacio bobadilla tapia
am 22 Jun. 2021
Kommentiert: ignacio bobadilla tapia
am 22 Jun. 2021
Hello, please if you could help me to fit a function to a data series, I understand that the 'fit' function of matlab works excellent, but it does not give me good results. What I have to do is fit the best possible function to a figure that has the semi-logarithmic vertical scale. I attach the data and the respective figure. Thanks greetings.
load x.txt
load y.txt
semilogy(x,y,'ob')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/660635/image.png)
0 Kommentare
Antworten (1)
KSSV
am 22 Jun. 2021
x = importdata('x.txt') ;
y = importdata('y.txt') ;
y = log(y) ;
p = polyfit(x,y,2) ;
yi = polyval(p,x) ;
plot(x,y,'.r',x,yi,'.b')
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!