Home > rest_20090422 > rest_spm5_files > @create_file_array > private > offset.m

offset

PURPOSE ^

Format

SYNOPSIS ^

function varargout = offset(varargin)

DESCRIPTION ^

 Format
 For getting the value
 dat = offset(obj)

 For setting the value
 obj = offset(obj,dat)
 _______________________________________________________________________
 Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

DOWNLOAD ^

offset.m

SOURCE CODE ^

0001 function varargout = offset(varargin)
0002 % Format
0003 % For getting the value
0004 % dat = offset(obj)
0005 %
0006 % For setting the value
0007 % obj = offset(obj,dat)
0008 % _______________________________________________________________________
0009 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
0010 
0011 %
0012 % $Id: offset.m 253 2005-10-13 15:31:34Z guillaume $
0013 
0014 
0015 
0016 if nargin==2,
0017     varargout{1} = asgn(varargin{:});
0018 elseif nargin==1,
0019     varargout{1} = ref(varargin{:});
0020 else
0021     error('Wrong number of arguments.');
0022 end;
0023 return;
0024 
0025 function dat = ref(obj)
0026 dat = obj.offset;
0027 return;
0028 
0029 function obj = asgn(obj,dat)
0030 if isnumeric(dat) && numel(dat)==1 && dat>=0 && rem(dat,1)==0,
0031     obj.offset = double(dat);
0032 else
0033     error('"offset" must be a positive integer.');
0034 end;
0035 return;

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