• / 21
  • 下载费用:10 金币  

matlab讲义9.ppt

关 键 词:
matlab讲义9.ppt
资源描述:
Week 9,3D Plots 4D Plots Movies,The 3D version of plot is:plot3(x1,y1,z1,s1,x2,y2,z2,s2,…),Three-dimensional Graphics,t = 0:pi/50:10*pi; plot3(sin(t),cos(t),t);,Curve plot in 3D,Surface Plot,X (resp. Y) is a matrix containing all the x-coordinates (resp. y) of the points on the grid, i.e. (X(i,j), Y(i,j)) is the coordinate of the (i,j)-th point in the grid.,compute Z at each coordinate in the mesh and plot,To plot, [X,Y]=meshgrid(-6 : 0.1 : 6, -6 : 0.1 : 6); R=sqrt(X.^2+Y.^2+.1); Z=sin(R)./R; mesh(X,Y,Z),The Mexican Hat, meshz(X,Y,Z) plot with zero plane, meshc(X,Y,Z) draws the underlying contours, surf(X,Y,Z) surface is filled with plates, surfnorm(X,Y,Z) plot normal vectors, shading interp; surface is shaded by interpolation, view(10,60); view from different angle, colormap(hot); surface is shaded with different color, colorbar bar gives height, contour(X,Y,Z,20) 20 contour lines, contour3(X,Y,Z,20) 20 contour lines in 3D with correct height,How to generate a sphere? [X,Y,Z]=sphere(20); % sphere with 20 longitudes and 20 latitudes surf(X,Y,Z),How is it done in Matlab? First generate a rectangular grid of longitudes and latitudes n=20; [long,lat] = meshgrid(-pi: 2*pi/n :pi, -pi/2: pi/n :pi/2);,X = cos(lat) .* cos(long); Y = cos(lat) .* sin(long);,These latitude and longitude values are then mapped to the X and Y spherical coordinates., Z = sin(lat); surf(X, Y, Z);,Using the X and Y spherical coordinates, we can compute the Z spherical coordinate, and plot the surface:,Four-dimensional Graphics,How to visualize 4D volume:,Cut the volume by planes. On each plane, illustrate the value of V by different colors,The Program:,Contour plots: contourslice(X,Y,Z,V,[],[0],[],20) Plot 20 contour lines on the plane y=0,Isosurface plots: isosurface(X,Y,Z,V,1) Draw the surface where V=1,Movie,30 Frames per second,How movie is made?,Let’s generate the Mexican hat surface and rotate it around,,
展开阅读全文
  微传网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
0条评论

还可以输入200字符

暂无评论,赶快抢占沙发吧。

关于本文
本文标题:matlab讲义9.ppt
链接地址:https://www.weizhuannet.com/p-7357042.html
微传网是一个办公文档、学习资料下载的在线文档分享平台

微传网博客

 网站客服QQ:80879498  会员QQ群:727456886

copyright@ 2018-2028 微传网络工作室版权所有

     经营许可证编号:冀ICP备18006529号-1 ,公安局备案号:13028102000124

收起
展开