Home > marsbar > @mardo_2 > savestruct.m

savestruct

PURPOSE ^

saves data in def_struct into .mat file with variable name SPM

SYNOPSIS ^

function savestruct(obj, filename)

DESCRIPTION ^

 saves data in def_struct into .mat file with variable name SPM
 FORMAT savestruct(object, matname)  

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function savestruct(obj, filename)
0002 % saves data in def_struct into .mat file with variable name SPM
0003 % FORMAT savestruct(object, matname)
0004 %
0005 % $Id$
0006   
0007 if nargin ~= 2
0008   error('Need matfile name');
0009 end
0010 
0011 % allow args to be in reverse order
0012 if ischar(obj)
0013   tmp = obj;
0014   obj = filename;
0015   filename = tmp;
0016 end
0017 
0018 % Convert vols to native format
0019 obj = convert_vols(obj, native_vol_ver(obj));
0020 
0021 % unobjectify marsy object before save
0022 SPM = des_struct(obj);
0023 if isfield(SPM, 'marsY')
0024   SPM.marsY = y_struct(SPM.marsY);
0025 end
0026 
0027 save(filename,'SPM');
0028 return

Generated on Thu 17-Mar-2016 01:14:46 by m2html © 2005