


_______________________________________________________________________ Copyright (C) 2005 Wellcome Department of Imaging Neuroscience



0001 function t = mystruct(obj) 0002 % _______________________________________________________________________ 0003 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience 0004 0005 % 0006 % $Id: mystruct.m 253 2005-10-13 15:31:34Z guillaume $ 0007 0008 0009 if numel(obj)~=1, 0010 error('Too many elements to convert'); 0011 end; 0012 fn = fieldnames(obj); 0013 for i=1:length(fn) 0014 t.(fn{i}) = subsref(obj,struct('type','.','subs',fn{i})); 0015 end; 0016 return;