


Overloaded reshape function for file_array objects _______________________________________________________________________ Copyright (C) 2005 Wellcome Department of Imaging Neuroscience



0001 function a = reshape(b,varargin) 0002 % Overloaded reshape function for file_array objects 0003 % _______________________________________________________________________ 0004 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience 0005 0006 % 0007 % $Id: reshape.m 253 2005-10-13 15:31:34Z guillaume $ 0008 0009 0010 if length(struct(b))~=1, error('Can only reshape simple file_array objects.'); end; 0011 0012 args = []; 0013 for i=1:length(varargin), 0014 args = [args varargin{i}(:)']; 0015 end; 0016 if prod(args)~=prod(b.dim), 0017 error('To RESHAPE the number of elements must not change.'); 0018 end; 0019 a = b; 0020 a.dim = args; 0021