Home > custom > grid_tools > set_xyborder.m

set_xyborder

PURPOSE ^

set different borders for x and y axis

SYNOPSIS ^

function grid = set_xyborder(grid,bx,by,bvalue)

DESCRIPTION ^

 set different borders for x and y axis 
 alpha (check if it works correctly)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function grid = set_xyborder(grid,bx,by,bvalue)
0002 % set different borders for x and y axis
0003 % alpha (check if it works correctly)
0004 bxl=0;bxr=0;byt=0;byb=0;
0005 bxl(bx>0)=bx;bxr(bx<0)=abs(bx);
0006 byb(bx>0)=by;byt(by<0)=abs(by);
0007 grid(1:byt,:)=bvalue; %toprows
0008 grid(size(grid,1)-byb+1:size(grid,1),:)=bvalue; %bottom rows
0009 grid(:,1:bxl)=bvalue; %left cols
0010 grid(:,size(grid,2)-bxr+1:size(grid,2))=bvalue; %right cols

Generated on Tue 24-Feb-2009 19:14:50 by m2html © 2003