function [fitresult,gof] = createInterpFit(LOCS, PKS)
%CREATEFIT(LOCS,PKS)
%  Create a fit.
%
%  Data for 'interpolantfit' fit:
%      X Input : LOCS
%      Y Output: PKS
%  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 12-Jan-2018 16:06:57


%% Fit: 'interpolantfit'.
[xData, yData] = prepareCurveData( LOCS, PKS );

% Set up fittype and options.
ft = 'linearinterp';

% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, 'Normalize', 'on' );

% % Plot fit with data.
% figure( 'Name', 'interpolantfit' );
% h = plot( fitresult, xData, yData );
% legend( h, 'PKS vs. LOCS', 'interpolantfit', 'Location', 'NorthEast' );
% % Label axes
% xlabel LOCS
% ylabel PKS
% grid on


