Aanderaa Temperature MATLAB Implementation

function [temperature] = aanderaa_temperature ( temperature_counts, tcals )
% AANDERAA_TEMPERATURE:  calculate temperature from raw aanderaa engineering units
%
% USAGE:  [temperature] = aanderaa_temperature ( temperature_counts, tcals );
%
% PARAMETERS:
% Input:
%    temperature_counts:
%        temperature raw engineering units as reported by Aanderaa Current Meter
%    tcals:
%        temperature calibration coefficients.  See the Aanderaa manual.
% Output:
%    temperature:
%        in degrees celsius



x = temperature_counts;
temperature = tcals(1) + tcals(2)*x + tcals(3)*x.^2 + tcals(4)*x.^3;


return;