1 |
function J = jet0(m) |
2 |
%JET0 Variant of JET. |
3 |
% JET0(M), a variant of JET(M), is the colormap used with the |
4 |
% NCSA fluid jet image, but with the central colors set to white. |
5 |
% JET0, by itself, is the same length as the current colormap. |
6 |
% Use COLORMAP(JET0). |
7 |
% |
8 |
% See also JET, HSV, HOT, PINK, FLAG, COLORMAP, RGBPLOT. |
9 |
|
10 |
% taken from jet.m, Martin Losch, 3-8-02 |
11 |
% C. B. Moler, 5-10-91, 8-19-92. |
12 |
% Copyright 1984-2001 The MathWorks, Inc. |
13 |
% $Revision: 1.1 $ $Date: 2002/10/22 13:30:40 $ |
14 |
|
15 |
if nargin < 1, m = size(get(gcf,'colormap'),1); end |
16 |
n = max(round(m/4),1); |
17 |
x = (1:n)'/n; |
18 |
y = (n/2:n)'/n; |
19 |
e = ones(length(x),1); |
20 |
r = [0*y; 0*e; x; e; flipud(y)]; |
21 |
g = [0*y; x; e; flipud(x); 0*y]; |
22 |
b = [y; e; flipud(x); 0*e; 0*y]; |
23 |
J = [r g b]; |
24 |
while size(J,1) > m |
25 |
J(1,:) = []; |
26 |
if size(J,1) > m, J(size(J,1),:) = []; end |
27 |
end |
28 |
% set central colors to white |
29 |
if mod(m,2) |
30 |
ic = ceil(m/2); |
31 |
J(ic-1:ic+1,:) = ones(3,3); |
32 |
else |
33 |
J(m/2:m/2+1,:) = ones(2,3); |
34 |
end |