home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
WINDOWS
/
DIVERSEN
/
MATHS171
/
RESHAPE.M
< prev
next >
Wrap
Text File
|
1994-01-23
|
385b
|
18 lines
function [Y] = reshape( X, m, n)
%Y=reshape( X, m, n)
%Reshapes matrix X to an m by n size. X must contain m*n elements
% S.Halevy 7/31/92
% Copyright (c) 1992 by the MathWizards
if (nargin ~= 3)
error('reshape needs 3 arguments (A,m,n)');
end
if (prod(size(X)) ~= m*n)
error('X does not have m*n elements.');
end
Y = zeros(m,n);
Y(:) = X;
return