MATLAB: How to modify the colobar settings

colobar

Just a simple question!!
How can I obtain following requirement for the colorbar?
  • add units
  • move colobar tilte to the desired position

Best Answer

You could try this:
c = colorbar;
units = ' m';
c.TickLabels{end} = [c.TickLabels{end} units];
c.Location = 'westoutside';