Project

curve fit

clear all
close all
clc

%preparing the data

cp_data=load(\'data\');
temperature=cp_data(:,1);
cp=cp_data(:,2);




%curve fit

%cp=a*T^3+b*T^2+c*T+d

co_effs=polyfit(temperature,cp,3);
predicted_cp=polyval(co_effs,temperature);

%compare my curve fit with orginal data

plot(temperature,cp,\'linewidth\',3)
hold on
plot(temperature,predicted_cp,\'linewidth\',3,\'color\',\'r\')
xlabel(\'temperature[K]\')
ylabel(\'specific heat[KJ/KmolK]\')
legend(\'orginal dataset\',\'curve fit\')
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.