home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / WINDOWS / DIVERSEN / MATHS171 / ALL_GRP.M next >
Text File  |  1994-01-23  |  2KB  |  92 lines

  1. % Demonstration of MathViews graphics
  2.  
  3. %       S.Halevy 7/31/92
  4. %       Copyright (c) 1992 by the MathWizards
  5.  
  6. clear
  7. gwsel(0)
  8. n=8;
  9. x=(0:n)/n;
  10. y=x.*(1.2-x);
  11. y /= max(y);
  12. z=y'*y;
  13. fill3d(z)
  14. surcnt(689,z)
  15. surcnt(2209,z)
  16.  
  17. plot(x,'+',x,y,'g',y/2)
  18.  
  19. % multiple graphic windows
  20. contour(z)
  21. plot(z)
  22.  
  23. % subplots
  24. subplot(221)
  25. plot(x,y)
  26. grid
  27. xlabel('X Axis')
  28. plot(x,z),grid,ylabel('Y Axis')
  29.  
  30. % contour
  31. contour(z)
  32. grid
  33. title('Title')
  34.  
  35. mesh(z)
  36.  
  37. %subplot
  38. subplot(211)
  39. plot(x,y),grid
  40. plot(x,z),grid
  41. subplot
  42.  
  43. plot(x,y)
  44. % hold
  45. hold on
  46. plot(x,z)
  47. plot(x,y)
  48. hold off
  49.  
  50. %mesh/contour plot
  51. epsi = 1e-14;
  52. x=(-24:3:24)/3;
  53. y=x';
  54. X=ones(y)*x;
  55. Y=y*ones(x);
  56. R=sqrt(X.^2+Y.^2) + epsi;
  57. Z=sin(R)./R;
  58. mesh(Z)
  59. contour(Z),grid,xlabel('range'),ylabel('doppler'),title('Contour')
  60.  
  61. % contours with labels
  62. cntrlb(Z),grid,xlabel('range'),ylabel('doppler'),title('Contour')
  63.  
  64. % NOTE: surcnt() (Surface-Contour) and fill3d() syntax and options are
  65. % subject to change in later versions for 4.0 compatibility
  66.  
  67. %options for surface contours
  68. %    1 - hide surface
  69. %   16 - backfill
  70. %   32 - fill contour
  71. %   64 - line contour
  72. %  128 - frame
  73. %  256 - back frame
  74. %  512 - draw filled surface
  75. % 1024 - draw a single color wire frame
  76. % 2048 - draw multi-colored wires
  77.  
  78. opt = 1+128+512+1024;  % fill3d
  79. surcnt(opt,Z)
  80.  
  81. opt=1+32+64+128+256+512+1024;
  82. surcnt(opt,Z)
  83.  
  84. %opt=1+32+128+256+2048;
  85. %surcnt(opt,Z)
  86.  
  87. %opt=1+32+128+2048;
  88. %surcnt(opt,Z)
  89.  
  90. %opt=1+16+32+128+512;
  91. %surcnt(opt,Z)
  92.