べき乗則の近似式算出に関して
Show older comments
ある実験データがべき乗則に従うと考えられるので近似式を算出したいと考えております。
下記のコードで算出しようと試みておりますがどうも算出出来ないようです。
xdata=[43200,86400,345600,691200]
ydata=[1.29*10^-6,2.37*10^-6,3.36*10^-6,5.33*10^-6]
fun = @(x,xdata)x(1)*xdata.^x(2)
x0=[0,0]
x=lsqcurvefit(fun,x0,xdata,ydata)
times = linspace(10^4,10^7);
loglog(times,fun(x,times),'k-','LineWidth',2)
hold on
scatter(xdata,ydata)
エクセルで算出するとy=1*10^-8*x^0.46程度になりそうです。
一方でcurve fitting toolsを使用してべき乗則に近似すると
y=1.4*10^-9*x^0.62
となるようです。
どのようなコードを用いれば べき乗則の近似曲線を求めることができるかお教えください。
またエクセルとMatlabで近似曲線の算出結果になぜ違いが出るのかお教えください。
Accepted Answer
More Answers (0)
Categories
Find more on 線形回帰と非線形回帰 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!