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: CBIG_MMP_GenerateColorscale.m
    path of file: ./repos/CBIG/stable_projects/predict_phenotypes/Ooi2022_MMP/generate_figures/feature_importance_figures
    
    the code of the file until where you have to start completion: function colorscale = CBIG_MMP_GenerateColorscale(cmap, out_dir)

% function colorscale = CBIG_MMP_GenerateColorscale(cmap, out_dir)

    
function colorscale = CBIG_MMP_GenerateColorscale(cmap, out_dir)

% function colorscale = CBIG_MMP_GenerateColorscale(cmap, out_dir)
% CBIG_MMP_create_annot_r_overlay_Schaefer400(input_vec, out_dir, lims, cmap)
% This function was was adapted from CBIG_TRBPC_create_annot_r_overlay_Schaefer400,
% creates the required colormap and saves the colorbar.
%
% Input:
% - out_dir: path to an output directory
% - cmap: a string that specifies what colour map is needed. Options are
% 'hot', 'cold', 'red_yell', 'blue_cyan' and 'hot_cold'.
%
% Output:
% colorscale: new colormap
%
% Written by Ruby Kong & CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

    res = 140;
    if strcmp(cmap, 'hot')
        RGB_new = [255 0 0;
            255 31  31;
            255 56  56;
            255 92  92;
            255 120 120;
            255 158 158;
            255 186 186;
            255 214 214;
            255 255 255];
    end