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: view_nii.m
    path of file: ./repos/malini/NIFTI
    
    the code of the file until where you have to start completion: %  VIEW_NII: Create or update a 3-View (Front, Top, Side) of the 
%	brain data that is specified by nii structure
%
%  Usage:  	status = view_nii([h], nii, [option])	or
%		status = v
    
function h1 = plot_cbar(fig, cbar_axes, cbarminmax_axes, cbarminmax, ...
	level, handles, useimagesc, colorindex, color_map, ...
	colorlevel, highcolor, niiclass, numscan, nii_view)

   cbar_image = [1:level]';

   %  In a uint8 or uint16 indexed image, 0 points to the first row 
   %  in the colormap
   %
   if 0 % strcmpi(niiclass,'uint8') | strcmpi(niiclass,'uint16')
      % we use single for display anyway
      ylim = [0, level-1];
   else
      ylim = [1, level];
   end