Home > rest_20090422 > rest_spm5_files > @create_file_array > reshape.m

reshape

PURPOSE ^

Overloaded reshape function for file_array objects

SYNOPSIS ^

function a = reshape(b,varargin)

DESCRIPTION ^

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

reshape.m

SOURCE CODE ^

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

Generated on Wed 29-Apr-2009 01:06:38 by m2html © 2005