fork download
  1. width = 160;
  2. height = 120;
  3. mask = zeros(width, height);
  4.  
  5. center_x = width / 2;
  6. center_y = height / 2;
  7. radius = min(width, height) / 2;
  8. radius2 = radius ^ 2;
  9. for i = 1 : width
  10. for j = 1 : height
  11. dx = i - center_x;
  12. dy = j - center_y;
  13. dx2 = dx ^ 2;
  14. dy2 = dy ^ 2;
  15. mask(i, j) = dx2 + dy2 <= radius2;
  16. end;
  17. end;
  18.  
  19. picture = randn(width, height); % test image :)
  20. masked_image = picture .* mask;
  21. imagesc(masked_image);
  22.  
  23. print out.png
Success #stdin #stdout #stderr 2.79s 70144KB
stdin
Standard input is empty
stdout
stderr
warning: print.m: epstool binary is not available.
Some output formats are not available.
warning: print.m: fig2dev binary is not available.
Some output formats are not available.
warning: print.m: pstoedit binary is not available.
Some output formats are not available.