reverse-shooting

Matlab scripts for reverse shooting
Log | Files | Refs | README

checkbd.m (463B)


      1 % Checkerboard.m    
      2 %	Similar to PCOLOR, except allows my favorite modifications
      3 %	Checkerboard plot with names, e.g. for (0,1) variable y.
      4 
      5 function y = checkerbd(y,names,xlab);
      6 [N K]=size(y)
      7 y=[zeros(1,K+1); y zeros(N,1)];
      8 y=flipud(y);
      9 y=replace(y,y==0,NaN); 		% To turn off zeros
     10 pcolor(y);
     11 colormap('hsv');
     12 
     13 if exist('xlab')~=1;
     14    xlab=1:K;
     15 end;
     16 set(gca,'XTick',1:K);
     17 set(gca,'YTick',1:N);
     18 set(gca,'YTickLabels',flipud(names));
     19 set(gca,'XTickLabels',xlab);