% plot box with background Usage: plot_square_with_background(x,y,w); x,y: position w: sidelength
0001 %% plot box with background 0002 % 0003 % Usage: 0004 % plot_square_with_background(x,y,w); 0005 % 0006 % x,y: position 0007 % w: sidelength 0008 0009 function plot_square_with_background(x,y,w,f1,f2) 0010 0011 if nargin < 4 0012 f1 = 4; 0013 f2 = 2; 0014 end 0015 0016 hi = w/2; 0017 ho = hi; 0018 0019 plot([x-hi,x-hi,x+hi,x+hi,x-hi],[y-hi,y+hi,y+hi,y-hi,y-hi],'-k','Linewidth',f1); 0020 plot([x-ho,x-ho,x+ho,x+ho,x-ho],[y-ho,y+ho,y+ho,y-ho,y-ho],'-y','Linewidth',f2);