


Display a file_array object _______________________________________________________________________ Copyright (C) 2005 Wellcome Department of Imaging Neuroscience




0001 function disp(obj) 0002 % Display a file_array object 0003 % _______________________________________________________________________ 0004 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience 0005 0006 % 0007 % $Id: disp.m 253 2005-10-13 15:31:34Z guillaume $ 0008 0009 0010 if numel(struct(obj))>1, 0011 fprintf(' %s object: ', class(obj)); 0012 sz = size(obj); 0013 if length(sz)>4, 0014 fprintf('%d-D\n',length(sz)); 0015 else 0016 for i=1:(length(sz)-1), 0017 fprintf('%d-by-',sz(i)); 0018 end; 0019 fprintf('%d\n',sz(end)); 0020 end; 0021 else 0022 display(mystruct(obj)) 0023 end; 0024 return; 0025 %======================================================================= 0026 0027 %======================================================================= 0028 function t = mystruct(obj) 0029 fn = fieldnames(obj); 0030 for i=1:length(fn) 0031 t.(fn{i}) = subsref(obj,struct('type','.','subs',fn{i})); 0032 end; 0033 return; 0034 %=======================================================================