function gas = cruisepid(desiredSpeed, currentSpeed)
% gas must be in the range of 0 (coasting) to 10 (pedal to the metal)

% You can define persistent variables like this
% https://www.mathworks.com/help/matlab/ref/persistent.html
persistent p;
if isempty(p) % The variable will be an empty matrix on the first run,
  p = 0;      % so you can initialize it like this
end

gas = 1; % Very bad cruise control algorithm, but at least the car will go.

end

