Where, T is the temperature in Kelvin, Beta (or β) is the thermal expansion coefficient (1/K), and Alpha (or α) is the thermal diffusivity (m2/s). Using MATLAB find the properties for T= 321, 440, and 571, respectively.

5 visualizaciones (últimos 30 días)
clc
clear all
T=[300 400 500 600];
Beta=[1.33e3 1.5e3 0.86e3 0.65e3];
Alpha=[0.2128e4 0.4625e4 0.6384e4 0.7190e4];
coeff_Beta=polyfit(T,Beta,1);
Beta =@(T) coeff_Beta(1)*(T)+coeff_Beta(2);
coeff_Alpha=polyfit(T,Alpha,1);
Alpha =@(T) coeff_Alpha(1)*(T)+coeff_Alpha(2);
T=[321 440 571];
Beta=Beta(T);
Alpha=Alpha(T);
table(T',Beta',Alpha','variableNames',{'T','Beta','Alpha'})
There is an error occuring in the last line, kindly tell me the problem in the syntax!

Respuesta aceptada

Alan Stevens
Alan Stevens el 18 de Feb. de 2021
I get no error when running your script exactly as it is:
ans =
3×3 table
T Beta Alpha
___ ______ ______
321 1430.7 2895.8
440 1111.8 4912.3
571 760.72 7132.1
However, I suggest you don't use identical names for a variable and a function. For example, I'd change
Beta =@(T) coeff_Beta(1)*(T)+coeff_Beta(2);
to something like
Betafn =@(T) coeff_Beta(1)*(T)+coeff_Beta(2);
etc.
  7 comentarios
Alan Stevens
Alan Stevens el 20 de Feb. de 2021
" ... I want to find the value of T (the same question above, that you have answered) ..."
The initial question did not find the value of T! The values of T were specified and the routine found the corresponding values of Alpha and Beta. If that's what you want from the interpolating polynomial, then use [300 400 500 600] for x, [1.33e3 1.5e3 0.86e3 0.65e3] for y (to find the corresponding Beta values) and the values [321 440 571] for x0.
Ameer Hamza
Ameer Hamza el 20 de Feb. de 2021
Yes I need to find the values of Alpha and Beta for T = 321 and 571 respectively by Newtons Divided Difference Mehod

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Polynomials en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by