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

📄 grayish.m

📁 Matlab下的EEG处理程序库
💻 M
字号:
function cmap = grayish(cmap,minval);

% GRAYISH - gray out the lower end of a spectrum for less severe palette
% function cmap = grayish(cmap,minval);
% assumes standard two-dimensional color map of three columns

% $Revision: 1.2 $ $Date: 2003/03/02 03:20:44 $


[m,n] = size(cmap);

if(length(minval) == 1),
  minval = minval + zeros(1,3);
end

for i = 1:3,
 cmap(:,i) = max(cmap(:,i),minval(i)); % set threshold
end

startndx = 0; % looking for highest index
for i = 1:3,
  startndx = max(startndx,min(find(cmap(:,1) > minval(i))));
end

% so color above this are above the minval

cmap = cmap(startndx:end,:); % only those values

% now rescale to full range by interpolating
mtrunc = size(cmap,1); % new length
ndx = [0:(mtrunc-1)]/(mtrunc-1)*(m-1); % scales to new range

cmap = interp1(ndx,cmap,[0:(m-1)]);

return

⌨️ 快捷键说明

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