view aim-mat/tools/@field/shift.m @ 0:74dedb26614d

Initial checkin of AIM-MAT version 1.5 (6.4.2011).
author tomwalters
date Fri, 20 May 2011 12:32:31 +0100
parents
children
line wrap: on
line source
function f=shift(f,x1,x2)
% shift the part of the matrix with the beginning x1 to x2 
% The size of the matrix might be increased
% The rest is filled with zeros

% first, shift the rest to the right
d=getdata(f);
s=size(d);
stop=s(2);
stop2=x2-x1+stop;
d(:,x2:stop2)=d(:,x1:stop);

% fill the left part with zeros
d(:,1:x2-1)=0;

f=field(d);