cast_numeric.m

来自「这是一个关于MATLAB的函数」· M 代码 · 共 42 行

M
42 行
字号
function resp = cast_numeric(nn,datatype,siz)
% Private. Cast to another object with different datatype.
%   Copyright 2002 The MathWorks, Inc.
%   $Revision: 1.6 $  $Date: 2002/05/30 15:34:54 $

if ~ishandle(nn),
    error('First Parameter must be an NUMERIC handle.');
end
if ~ischar(datatype),
     error('Second Parameter must be a string.');
end
if nargin==3
	if ~isnumeric(siz),
         error('Third Parameter must be numeric.');
    end
    if any(siz<=0)
        error(['Invalid size : [' num2str(siz) '], negative indices are not allowed ']);
    end         
end

% Copy constructor
mm = copy(nn);

% Convert datatype
if strcmp(mm.procsubfamily(1:2),'C6'), % C6x
    cast_C6xx(mm,datatype);
elseif strcmp(mm.procsubfamily,'C54x'), % C5x
    cast_C54x(mm,datatype);
else
    error('Processor not supported');
end

% Reshape dimension of MM
if nargin==3 
    reshape(mm,siz);
end

% Return MM
resp = mm;

% [EOF] cast.m

⌨️ 快捷键说明

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