function steam % steam Sample interpolation in a steam table: set up and % solve 4 equations in 4 unknowns p = [1 1 2 2]'; T = [250 500 250 500]'; h = [2942.6 3478.5 2902.5 3467.6]'; A = [ ones(4,1) p T p.*T] c = A\h; fprintf('\nSolution is: c = \n'); fprintf('\t%18.5e\n',c); Ttest = [ 250 400 ]'; ptest = [1 1.75]'; htest = c(1) + c(2)*ptest(1) + c(3)*Ttest(1) + c(4)*ptest(1)*Ttest(1) htest - h(1)