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

📄 cast.m

📁 这是一个关于MATLAB的函数
💻 M
字号:
function resp = = cast(pp,datatype,size)
%   Copyright 2002 The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 2002/06/11 20:56:43 $

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

if strcmp(pp.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_numeric(pp,datatype);
       else
           resp = cast_numeric(pp,datatype,size);
       end
	else
        error('A pointer cannot have a non-32 bit datatype.');
	end
    
elseif strcmp(pp.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_numeric(pp,datatype);
       else
           resp = cast_numeric(pp,datatype,size);
       end
	else
        error('A pointer cannot have a non-16 bit datatype.');
	end
    
end
  
% [EOF] cast.m

⌨️ 快捷键说明

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