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

📄 iscolor.m

📁 有关matlab的电子书籍有一定的帮助希望有用
💻 M
字号:
function bool = iscolor(c)
%ISCOLOR  True if input is a color.
%   ISCOLOR(C) is 1 if c is a valid colorspec and 0 else.
%   Valid colorspecs are: 'r','g','b','w',... (a single character).
%                         [r g b] where r,g and b are scalars in [0,1]
%                         n-by-3 matrix with elements in the range [0,1]

%   Copyright (c) 1988-98 by The MathWorks, Inc.
% $Revision: 1.4 $

% Author: T. Krauss

if isstr(c)
    colorStr = {'y' 'm' 'c' 'r' 'g' 'b' 'w' 'k'};  % see 'help plot'
    bool = ~isempty(findcstr(colorStr,c));
else
    if any(abs(imag(c))>0.0)
        bool = 0;
    elseif min(size(c))>1
        if size(c,2)~=3
            bool = 0;
        else
            bool = max(max(c))<=1.0 & min(min(c))>=0.0;
        end
    else
        bool = max(max(c))<=1.0 & min(min(c))>=0.0;
    end
end

⌨️ 快捷键说明

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