curve fitting
Objective: code for curve fitting for linear polynomial(n=1) close all clear all clc %preparing the data cp_data=load(\'data\') temperature=cp_data(:,1); cp=cp_data(:,2); %curve fitting %cp=a*T^2 + b*T + c coefficients = polyfit(temperature,cp,1) predicted_cp=polyval(coefficients,temperature); %error in the function error=(1/length(cp))*sum((predicted_cp-cp).^2)…