If I do understand your question correctly you want to fit thermodynamic models, like NRTL or Wilson model, to some thermodynamic equilibrium data. Normally it is being done by fitting to equilibrium solid/liquid data.
I would suggest you to have a look at FACTSAGE and GEMS software packages. Because your task is not so trivial. Me myself was writing some Genetic Algorithm in C++ to fit large sets of data by NRTL, Wilson and some others models.
GEMS software, developed in Paul Scherrer Institut, http://gems.web.psi.ch/, has a great package called GemsFit. It allows to fit almost any types of data by different models.
Otherwise I do not think you can manage this problem only by means of MATLAB.
If you want to calculate coefficients, you just need to use "polyfit" and also "polyval" functions as the order of your polynomial. (As Mr. Tahir said before).
Or If you want to modify you dataset and compare the results, you need some software packages like FactSage, etc.
Curve fitting with polynomials is done in MATLAB with the polyfit
function, which uses the least squares method. The basic form of the polyfit
function is:
For the same set of m points, the polyfit function can be used to fit polynomials
of any order up to m-1 . If n = 1 the polynomial is a straight line, if n = 2
the polynomial is a parabola, and so on. The polynomial passes through all the
points if n=m-1 (the order of the polynomial is one less than the number of
points). It should be pointed out here that a polynomial that passes through all the
points, or polynomials with higher order, do not necessarily give a better fit overall.
High-order polynomials can deviate significantly between the data points.
p = polyfit(x,y,n)
x is a vector with the horizontal coordinates
of the data points (independent variable).
y is a vector with the vertical coordinates of
the data points (dependent variable).
n is the degree of the polynomial.
p is the vector of the coefficients
of the polynomial
that fits the data.
p=polyfit(x,y,3)
xp=0.9:0.1:9.5;
yp=polyval(p,xp);
plot(x,y,'o',xp,yp)
xlabel('x'); ylabel('y')
See page page 267-274 , if you need any help just ask, please.
Hazim
How can I find the coefficient for fitting a curve in MATLAB? - ResearchGate. Available from: https://www.researchgate.net/post/How_can_I_find_the_coefficient_for_fitting_a_curve_in_MATLAB [accessed Jul 8, 2015].
Try and download the book from the attached link ( look for my answer there you see the pdf of the book)