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

📄 colorspec_longname_to_rgbvalue.m

📁 在matlab中绘制3d箭头
💻 M
字号:
function RGBvalue = ColorSpec_LongName_to_RGBvalue(LongName)

% RGBvalue = ColorSpec_LongName_to_RGBvalue(LongName) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%     
%     Given the color 'LongName' ('red','green',...) convert to the matrix equivalent
%         
% Example:
%     val = ColorSpec_LongName_to_RGBvalue('magenta');
%     ------> returns the three-element equivalent to magenta = [1 0 1]
% 
% 
%     Author: Shawn Arseneau
%     Created: September 14, 2006
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    switch(lower(LongName))
        case 'yellow'
            RGBvalue = [1 1 0];
        case 'magenta'
            RGBvalue = [1 0 1];            
        case 'cyan'
            RGBvalue = [0 1 1];            
        case 'red'
            RGBvalue = [1 0 0];            
        case 'green'
            RGBvalue = [0 1 0];            
        case 'blue'
            RGBvalue = [0 0 1];            
        case 'white'
            RGBvalue = [1 1 1];            
        case 'black'
            RGBvalue = [0 0 0];            
        otherwise
            RGBvalue = [];  
            msg = sprintf('Unrecognized LongName: %s - See valid list (yellow, magenta, cyan, red, green, blue, white, black)', lower(LongName));
            error(msg); 
            return;
    end







⌨️ 快捷键说明

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