You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: BF_GetColorMap.m
    path of file: ./repos/hctsa/PeripheryFunctions
    
    the code of the file until where you have to start completion: function cmapOut = BF_GetColorMap(whichMap,numGrads,cellOut,flipMe)
% BF_GetColorMap    Colorbrewer colors for Matlab.
%
% Returns a nice set of colors to make a nice colormap using the color schemes
% from http://colorbrewer2.org/
%
% The online tool, colorbrewer2, is copyright Cynthia Brewer, Mark Harrower and
% The Pennsylvania State University.
%
%---INPUTS:
%
% whichMap, the name of a colormap (see long list below)
%
% numGrads, the number of colors to return from that color scheme (some maps can
%           support larger numbers of colors, and the minimum is usually 3)
%
% cellOut, (i) 1: returns a cell of colors, where each component is an rgb
%                 3-vector
%          (ii) 0: returns a numGrads x 3 matrix for use in the Matlab colormap
%                  function, for example
% flipMe, (i) 1: inverts the ordering of the colors.

    
function cmapOut = BF_GetColorMap(whichMap,numGrads,cellOut,flipMe)
% BF_GetColorMap    Colorbrewer colors for Matlab.
%
% Returns a nice set of colors to make a nice colormap using the color schemes
% from http://colorbrewer2.org/
%
% The online tool, colorbrewer2, is copyright Cynthia Brewer, Mark Harrower and
% The Pennsylvania State University.
%
%---INPUTS:
%
% whichMap, the name of a colormap (see long list below)
%
% numGrads, the number of colors to return from that color scheme (some maps can
%           support larger numbers of colors, and the minimum is usually 3)
%
% cellOut, (i) 1: returns a cell of colors, where each component is an rgb
%                 3-vector
%          (ii) 0: returns a numGrads x 3 matrix for use in the Matlab colormap
%                  function, for example
% flipMe, (i) 1: inverts the ordering of the colors.
%            (ii) 0: doesn't invert the ordering of the colors.
%
%---EXAMPLE USAGE:
%
% 1. Set the colormap to the redyellowblue colormap with 8 gradations:
% colormap(BF_GetColorMap('redyellowblue',8));
%
% 2. Set blue/red maps for [-1,+1] bounded data:
% caxis([-1,1])
% colormap([flipud(BF_GetColorMap('blues',9));1,1,1;BF_GetColorMap('reds',9)])
%
% 3. Get colors for lines and plot data stored in 5 rows of matrix y:
% myColors = BF_GetColorMap('accent',5); hold on
% for i = 1:5,
%     plot(y(i,:),'color',myColors(i,:));
% end