Advertisement
irapilguy

Untitled

Nov 9th, 2020
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.62 KB | None | 0 0
  1. >> [x y] = meshgrid(30:-10:0)
  2. >> A = [[1, 0.5, 0.2, 0.1], [0.5, 1, 0.6, 0.3], [0.2, 0.6, 1, 0.8], [0.1, 0.3, 0.8, 1]];
  3. >> surf(x,y,A)
  4. >> shading interp
  5.  
  6. +
  7.  
  8. >> clear
  9. >> [x y] = meshgrid(30:-10:0)
  10. >> z = exp(-0.2.*(x-y).^2)
  11. >> surf(x,y,z)
  12. >> shading interp
  13.  
  14. +
  15.  
  16. >> bar3(A);
  17. +
  18. >> clear
  19. >> [x y] = meshgrid(30:-10:0)
  20. >> B = [[0, 0.2, 0.6, 1], [0, 0, 0.2, 0.6], [0, 0, 0, 0.2], [0, 0, 0, 0]]
  21. >> surf(x,y,B)
  22. >> shading interp
  23.  
  24. +
  25.  
  26. >> for i = 1:1:4
  27. for j = 1:1:4
  28. if x(i,j) >= y(i,j)
  29. alfa(i,j) = 0;
  30. else
  31. alfa(i,j) = 1/(1+(5/(x(i,j)-y(i,j))^4));
  32. end
  33. end
  34. end
  35. >> surf(x,y,alfa)
  36. >> shading interp
  37.  
  38. +
  39. >> bar3(B);
  40. +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement