reshape.m

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

M
29 行
字号
function rr = reshape(rr,size)
%RESHAPE Change the SIZE property of a REGISTEROBJ object.
% 	RESHAPE(RR,SIZE) Changes the dimension or/and dimension size of RR.
% 	
% 	RESHAPE(RR,[]) does not change the existing SIZE property of RR.
% 	
% 	NOTE: For a registerobj, the SIZE property is always equal to 1.
%   Copyright 2002 The MathWorks, Inc.

%   $Revision: 1.2 $  $Date: 2002/03/29 13:35:05 $


error(nargchk(2,2,nargin));
if ~ishandle(rr),
    error('First Parameter must be a RNUMERIC Handle.');
end
if ~isnumeric(size),
    error('SIZE must be a numeric.');
elseif prod(size)>1
    error('Cannot reshape. SIZE of a Register Object is always a scalar.');
end

if ~isempty(size),
    rr.size = size;
    % else, use existing size info
end

% [EOF] reshape.m

⌨️ 快捷键说明

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