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

resize_scales

PURPOSE ^

Resize scalefactors

SYNOPSIS ^

function s1 = resize_scales(s0,dim,args)

DESCRIPTION ^

 Resize scalefactors 
 _________________________________________________________________________________
 Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

resize_scales.m

SOURCE CODE ^

0001 function s1 = resize_scales(s0,dim,args)
0002 % Resize scalefactors
0003 % _________________________________________________________________________________
0004 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
0005 
0006 %
0007 % $Id: resize_scales.m 315 2005-11-28 16:48:59Z john $
0008 
0009 dim = [dim ones(1,max(numel(args)-numel(dim),0))];
0010 args1 = cell(1,numel(args));
0011 for i=1:numel(args),
0012     if max(args{i})>dim(i) || min(args{i})<1,
0013         error('Index exceeds matrix dimensions (1).');
0014     end;
0015 
0016     if size(s0,i)==1,
0017         args1{i} = ones(size(args{i}));
0018     else
0019         args1{i} = args{i};
0020     end;
0021 end;
0022 
0023 s1 = s0(args1{:});
0024

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