Borrar filtros
Borrar filtros

determine a relationship from Curve fitting

1 visualización (últimos 30 días)
S.Sil
S.Sil el 12 de Nov. de 2015
Comentada: Star Strider el 12 de Nov. de 2015
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.

Respuesta aceptada

Star Strider
Star Strider el 12 de Nov. de 2015
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 comentarios
S.Sil
S.Sil el 12 de Nov. de 2015
thanks.. how do i get the answers a and b as its not showing in my case.
Star Strider
Star Strider el 12 de Nov. de 2015
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).

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by