In Origin(8): Select the data you need to fit and plot them in a graph.
When the graph is active, select: Analysis--> Fitting--> Fit Linear--> Open dialog
The linear fit dialog window will appear that mostly you don’t need to change any parameter unless you need to extend the range of your fitting to a wider range than the original data rang or you may need to select “find X from Y” or “find Y from X” according to your needs. In this window, you may also need to change the Recalculate from “Manual” to “Auto” which helps in recalculating the fitting parameters if you change your data later.
Finally, press OK and go beck to your graph, you will see the fitting line plus a small table inside the graph showing you the fitting equation “y=a+bx” with the values of the fitting parameters. For further information, you may go to the Origin help and search for "Linear Fit". If you need to use different equation, (ex. not linear) then you have to use the “nonlinear curve fit”. Hope this will help you.
"Best fit" is one thing but uncertainties of so obtained parameters is another thing, equally important. If not satisfied with Matlab or Origin answers you may resort to another software, namely 'gnuplot'. It is free, small and works under Linux and Windows. In addition to highly configurable graphs, it contains a Levenberg-Marquard (Newton-like) fitting routine. One of the best among deterministic minimizers. Highly recommended. More at: