CURVE FIT USING MATLAB
curve fit: It is the process of constructing a curve or a mathematical function,and it has the relationship b/w orginal data set and predicted data set. Basically,the curve fit depends upon the polynomial equ... The polynomial equ are show below: linear equ/first degree polynomial:y=ax+b; quadratic equ/second degree polynomial:y=ax^2+bx+c; cubic equ/third degree polynomial:y=ax^3+bx^2+cx+d; the degree of polynomial can go 4,5 and so on; coading for linear and quadratic equ: clear all close all clc %loading data cp_data=load('data') temp=cp_data(:,1) cp=cp_data(:,2) %curve fit co_eff1=polyfit(temp,cp,3); predicted_cp=polyval(co_eff1,temp) co_eff2=polyfit(temp,cp,1); predicted_cp2=polyval(co_eff2,temp) %compare org fit,predicted fit plot(temp,cp,LineWidth=3); hold on plot(temp,predicted_cp,LineWidth=3) plot(temp,predicted_cp2,LineWidth=3) xlabel('temperature') ylabel('specific heat') legend('original c_p','cubic polynomial','linear polynomia...