determine a relationship from Curve fitting
1 次查看(过去 30 天)
显示 更早的评论
Well i am learning about curve fitting but got confused about one question and could not find proper help elsewhere. How do i find the relationship of a particular form in the curve fitting. I have the date given below: T= 200 600 1000 1400 K= 1.0 0.4 0.3 0.25
so i plot the given data using: %%Given data T=[200 600 1000 1400];% temperature K=[1 0.4 0.3 0.25];%thermal conductivity plot(T,K,'*')%ploting the data
now how do i determine a relationship of a specific form Tk^a=b with the given data.suppose a and b are constants.
0 个评论
采纳的回答
Star Strider
2015-11-12
A little algebra gives K=(b/T)^(1/a).
Using nlinfit:
T=[200 600 1000 1400];
K=[1 0.4 0.3 0.25];
Kfit = @(B,T) (B(2)./T).^(1./B(1)); % Model
B = nlinfit(T, K, Kfit, rand(2,1));
Tv = linspace(min(T), max(T));
figure(1)
plot(T,K,'*')
hold on
plot(Tv, Kfit(B,Tv), '-r')
hold off
grid
giving a=1.3 and b=199.
2 个评论
Star Strider
2015-11-12
My pleasure.
The easiest way is to just remove the semicolon (;) from the end of the nlinfit call:
B = nlinfit(T, K, Kfit, rand(2,1))
with a=B(1) and b=B(2).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!