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

📄 cast.m

📁 这是一个关于MATLAB的函数
💻 M
字号:
function resp = cast(re,datatype,size)
% CAST - Creates a copy RE, change its representation to DATATYPE and 
% optionally reshape to SIZE.
%
%   Copyright 2002 The MathWorks, Inc.
%   $Revision: 1.2 $  $Date: 2002/03/27 15:08:04 $

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
           resp = cast_rnumeric(re,datatype);
       else
           resp = cast_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
           resp = cast_rnumeric(re,datatype);
       else
           resp = cast_rnumeric(re,datatype,size);
       end
	else
        error('An enum cannot have a non-16 bit datatype.');
	end
    
end
        

% [EOF] cast.m

⌨️ 快捷键说明

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