Alternatively, you can hardcode them and have an if statement with graphicsversion(fhandle) on it.
It returns returns true if the default graphics system is the old handle graphics one.
You could also try to get an extensive list, and then check if colormapname.m is a file in matlabroot\toolbox\matlab\graph3d. If the function is there, the colormap comes in that version. You'd still need to hardcode an extensive list though.
EDIT: as @thewaywewalk suggests, you could open Contents.min matlabroot\toolbox\matlab\graph3d and esarch for % Color maps. It has a list of the colormaps included in the version. In 2014b its on lines 29-48
Alternatively, you can hardcode them and have an if statement with graphicsversion(fhandle) on it.
It returns returns true if the default graphics system is the old handle graphics one.
You could also try to get an extensive list, and then check if colormapname.m is a file in matlabroot\toolbox\matlab\graph3d. If the function is there, the colormap comes in that version. You'd still need to hardcode an extensive list though.
EDIT: as @thewaywewalk suggests, you could open Contents.min matlabroot\toolbox\matlab\graph3d and esarch for % Color maps. It has a list of the colormaps included in the version. In 2014b its on lines 29-48
A possibility to get an extensive list of available colormaps :
In matlabroot\help\matlab\ref, you can find previews of all available colormaps whose filenames are of the form colormap_colormapname.png
In order to get your list, you can use :
CurrFolder=pwd;
cd(strcat(matlabroot,'\help\matlab\ref'))
Colormaps=dir('*colormap_*.png');
TmpColormapsList={Colormaps.name};
TmpColormapsList=cellfun(@(S)strrep(S,'colormap_',''),TmpColormapsList,'UniformOutput',false);
ColormapsList=cellfun(@(S)strrep(S,'.png',''),TmpColormapsList,'UniformOutput',false);
cd(CurrFolder);
This will output a cell array of string containing the names of the available colormaps.
Pretty ugly hack, but at least it works on 2014b (Please check it for your version if you have another one)