Guest User

Untitled

a guest
Jan 18th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. >> a=X
  2.  
  3. a =
  4.  
  5. Columns 1 through 8
  6.  
  7. 0 50 100 150 200 250 300 350
  8.  
  9. Columns 9 through 16
  10.  
  11. 400 450 500 550 600 650 700 750
  12.  
  13. Columns 17 through 21
  14.  
  15. 800 850 900 950 1000
  16.  
  17. >> b=Y
  18.  
  19. b =
  20.  
  21. 0
  22. 50
  23. 100
  24. 150
  25. 200
  26. 250
  27. 300
  28. 350
  29. 400
  30.  
  31. >> c=Z
  32.  
  33. c =
  34. Columns 1 through 8
  35.  
  36. 0 0 0 0 0 0 0 0
  37. 16 32 67 98 127 164 194 234
  38. 120 171 388 773 1086 1216 1770 2206
  39. 189 270 494 1978 2755 3134 5060 10469
  40. 133 166 183 348 647 937 1446 2304
  41. 192 162 154 113 161 189 266 482
  42. 0 0 0 0 0 0 0 0
  43. 0 0 0 0 0 0 0 0
  44. 0 0 0 0 0 0 0 0
  45.  
  46. Columns 9 through 16
  47.  
  48. 0 0 0 0 0 0 0 0
  49. 366 604 529 504 346 226 228 179
  50. 4027 11186 10276 5349 2560 1322 996 799
  51. 27413 76387 37949 15591 5804 2654 1803 1069
  52. 9844 24152 14772 4613 1777 849 459 290
  53. 1288 2623 1538 582 280 148 90 56
  54. 0 0 0 0 0 0 0 0
  55. 0 0 0 0 0 0 0 0
  56. 0 0 0 0 0 0 0 0
  57.  
  58. Columns 17 through 21
  59.  
  60. 0 0 0 0 0
  61. 108 94 79 0 0
  62. 646 476 612 0 0
  63. 884 858 722 0 0
  64. 266 215 139 0 0
  65. 48 48 31 0 0
  66. 0 0 0 0 0
  67. 0 0 0 0 0
  68. 0 0 0 0 0
  69.  
  70.  
  71.  
  72. >> surf(X,Y,Z)
  73.  
  74. doc colormapeditor
  75.  
  76. %# add red (row 1), yellow (row 2), green (row 2)
  77. map = [1 0 0; 0 1 1; 0 1 0];
  78.  
  79. %# set the new map as the current map
  80. colormap(map);
  81.  
  82. colors = zeros(size(c)); %# create colors array
  83. colors(c <= 1803) = 1; %# red (1)
  84. colors(c > 1803 & c < 2755) = 2; %# yellow (2)
  85. colors(c >= 2755) = 3; %# green (3)
  86.  
  87. %# and pass it into surf
  88. surf(a,b,c, colors)
Add Comment
Please, Sign In to add comment