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

📄 convert.m

📁 这是一个关于MATLAB的函数
💻 M
字号:
function re = convert(re,datatype,size)
% CONVERT - Convert RE representation into DATATYPE and 
% optionally reshape it to SIZE.
%
%   Copyright 2002 The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 2002/03/29 22:50:10 $

nargchk(2,3,nargin);
if ~ishandle(re),
    error('First Parameter must be a RENUM Handle.');
end

if strcmp(re.procsubfamily(1:2),'C6')

    if isempty( strmatch(datatype,      ...
		{   'uint8',        'int8',     ...
            'uint16',       'int16',    ...
            'int64',        'uint64',   ...
		    'char',         'unsigned char',    'signed char',  ...
            'short',        'unsigned short',   'signed short', ...
		    'long',         'unsigned long',    'signed long',  ...
		    'double',       'long double',      'long long'     ...
		},  'exact') ),
    
       if nargin==2
           convert_rnumeric(re,datatype);
       else
           convert_rnumeric(re,datatype,size);
       end
	else
        error('An enum cannot have a non-32 bit datatype.');
	end
    
elseif strcmp(re.procsubfamily,'C54x')
    
	if isempty( strmatch(datatype, ...
		{   'uint8',        'int8',     ...
            'int32',        'uint32',   ...
            'int64',        'uint64',   ...
		    'long',         'unsigned long',    'signed long',  ...
		    'float',        ...
            'double',       'long double',      'long long'...
		},  'exact') ),
    
       if nargin==2
           convert_rnumeric(re,datatype);
       else
           convert_rnumeric(re,datatype,size);
       end
	else
        error('An enum cannot have a non-16 bit datatype.');
	end
    
end

% [EOF] convert.m

⌨️ 快捷键说明

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