Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Grid = 10;
  2. M = zeros(Grid);
  3. M(3,1:3)=1;M(2,3)=1;M(1,2)=1;
  4. Black = [0 0 0];
  5. White = [1 1 1];
  6. Red = [1 0 0];
  7. Background = White;
  8. colormap([Background; Red; Black])
  9. figure()
  10. imagesc(M)
  11.  
  12. 0 0 0 0 0 0 0
  13. 0 2 1 0 0 0 0
  14. 1 0 1 0 0 0 0
  15. 0 1 1 0 0 0 0
  16. 0 0 0 0 0 0 0
  17. 0 0 0 0 0 0 0
  18. 0 0 0 0 0 0 0
  19. 0 0 0 0 0 0 0
  20. 0 0 0 0 0 0 0
  21. 0 0 0 0 0 0 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement