Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. %% some data...
  2. % random image
  3. Image = rand(200,400);
  4. % 900 lines of random color
  5. color1 = rand(1,900);
  6. color2 = rand(2,900);
  7. color3 = rand(3,900);
  8. % some positions
  9. x = 31:60;
  10. y = 31:60;
  11. [X,Y] = meshgrid(x,y);
  12.  
  13. %% plot process
  14. % plot Image (with 'imshow' or 'imagesc')
  15. imshow(Image);
  16. hold on;
  17. % plot the lines (with 'line' or 'plot')
  18. for i = 1:900
  19. line([X(i), X(i)+1],[Y(i),Y(i)+2],'color',[color1(i),color2(i),color3(i)]);
  20. if i == 100 % nothings happens to background image after 100 vectors
  21. pause();
  22. elseif i == 200 % gradually starts to change...
  23. pause();
  24. end
  25. end
  26. % ... at the end it is completely erased
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement