LoginSignup
1
1

More than 5 years have passed since last update.

[MATLAB] colorbar

Last updated at Posted at 2015-12-25

%MATLAB colorbar

function [ colormapi ] = interp_cm( colormap, n )
%interpolate colormap
% Detailed explanation goes here

cms = size(colormap);
x = [0:1/(cms(1)-1):1];
xi = [0:1/(n-1):1];

colormapi = interp1(x, colormap, xi);

end

%Example:
%cm = interp_cm(colormap('jet'),24);
%colormap(cm);

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1