% this function creates a cell with a few numbers that are natural "ticks" 
% that can be used to label plots

% h = stepsize
% headspace = want to leave headspace on both ends?
function ticks = create_ticks(minn,maxx,h,headspace)

if headspace
    n_min = floor(minn/h);
    n_max = ceil(maxx/h);
    
    i = 1;
    for n=n_min:n_max
        ticks{i} = n*h;
        i = i+1;
    end
else
    n_min = ceil(minn/h);
    n_max = floor(maxx/h);
    
    i = 1;
    for n=n_min:n_max
        ticks{i} = n*h;
        i = i+1;
    end
end

end