function [row, col] = createFit(x, y,Nrow) %CREATEFIT(ROW,COL) % Create a fit. % % Data for 'untitled fit 1' fit: % X Input : x % Y Output: y % Output: % fitresult : a fit object representing the fit. % gof : structure with goodness-of fit info. % % See also FIT, CFIT, SFIT. % Auto-generated by MATLAB on 26-Mar-2015 20:34:21 %% Fit: 'untitled fit 1'. [xData, yData] = prepareCurveData( x, y ); % Set up fittype and options. ft = fittype( 'exp1' ); opts = fitoptions( 'Method', 'NonlinearLeastSquares' ); opts.Display = 'Off'; opts.StartPoint = [mean(y) -2.91002036924086e-06]; % Fit model to data. [fitresult, gof] = fit( xData, yData, ft, opts ); row=1:Nrow; col= fitresult.a * (exp(fitresult.b .*row)) ;%+ fitresult.c * (exp(fitresult.d .*row));