determine a relationship from Curve fitting

6 次查看(过去 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.

采纳的回答

Star Strider
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 个评论
S.Sil
S.Sil 2015-11-12
thanks.. how do i get the answers a and b as its not showing in my case.
Star Strider
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 CenterFile Exchange 中查找有关 Curve Fitting Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by