Tricks in MATLAB
From Computational Biophysics and Materials Science Group
Revision as of 18:24, 28 November 2014 by Kevin (Talk | contribs) (Created page with "==Quick fitting== http://www.mathworks.com/help/matlab/ref/polyfit.html a= 1:0.1:10; p = polyfit(a,exp(a),5); % Fits a fifth degree polynomial to exp(a) in the Least square...")
Quick fitting
http://www.mathworks.com/help/matlab/ref/polyfit.html
a= 1:0.1:10; p = polyfit(a,exp(a),5); % Fits a fifth degree polynomial to exp(a) in the Least squares sense v = polyval(p,a); plot(a,v,a,exp(a)) % You will see the difference.