⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmap.m

📁 精通Matlab综合辅导与指南 用于数学建模的教科书
💻 M
字号:
function map=mmap(c,m)%MMAP Single Color Colormap.% MMAP(C,M) makes a colormap of length M starting with the% basic colorspec C. The map changes from dark to light.% MMAP(C) is the same length as the current colormap.%% Example: mmap('y') is a yellow colormap%          mmap([.49 1 .83]) is an auqamarine colormap%          mmap('c',20) is a cyan colormap having length 20.%          mmap('c') is the default if C can not be interpreted.%% Apply using: colormap(mmap(c,m))%% D. Hanselman, University of Maine, Orono, ME  04469% 4/17/95% Copyright (c) 1996 by Prentice Hall, Inc.if nargin<=1, m=size(get(gcf,'colormap'),1); endif nargin==0, c=[0 1 1]; endcolors='ymcrgb';rgb=[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1];if isstr(c)  % colorspec is a letter	i=find(c==colors);	if isempty(i), i=3;end	c=rgb(i,:);  % convert it to an rgb vectorendif all(c==0),c=rgb(3,:);end % don't allow a black colormap!c=c./max(c); % normalize valuesn=ceil(1.1*m); % throw out black end of gray colormapmap=gray(ceil(1.1*m)); % generate gray colormap to colorizemap=map(n-m+1:n,:)*diag(c);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -