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

disp

PURPOSE ^

Display a file_array object

SYNOPSIS ^

function disp(obj)

DESCRIPTION ^

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

DOWNLOAD ^

disp.m

SOURCE CODE ^

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 %=======================================================================

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