MATLAB Exercise 8 School of Mathematical Sciences Xiamen University http∥gdjpkc.xmu.edu.cr MATLAB Exercise 8-Graphics -Curve 1. Plot following 2-D curve 1)y [0,6] e)x=4sint, y= 4 cost, t E[0, 2T] 3)x4+y2-8x2-10y2+16=0 2. Let x∈[0,10] 1+x 1)Set n=1, 5, 10respectively; display the corresponding curve Cr, C2, C, at the same axes; 2)Use different color to distinguish the curves 3)Legend the curves 5) Label the x-axis with X轴' and y-axis with函数值 3. Add title for 4)in Exl with "Plot of p=4 cos 36 Let x*+y-2(x+y)=b 1)Plot 4 figures Ci, C2, C3, C4 with b=1.0,-07,-1.0,-1.05; 2)Partition the figure into 4 subplots, plot Ci, C2, C3, C4 into the subplots in turn. 5. Create 2 figures which plot the following 3-D curves, respectively. 1)x=0.5t2,y=0.Ir3,z=9cos2t,t∈[0,6] 2)x=0.5sint, y=0. 1cost, ==cos 2L, tE[0, 9 6. Plot polylines(sx)with following data on the same axes. Distinguish them by color and line shape and legend them 1)x=[0,1,4,5,7,y=[1,3,4,5,56]; 2)x=[,2,3,4,5]y=[2,4,1,6,3] 7. Let f(x) 5+4co f(x)=f(x),f(x)=f(x),8(x)=(x 1)Plot f(x),f(x),f,(x)respectively, 2)Observe the plots of f(x)and g(r)are the same? Break the Figure window into an 1-by-2 matrix of small axes, plot f(x)and g(x) 3)Let e be the error between f(x)and g(x) Display the function e and plot it. what do you 8.*Plot three circles with the same center in one figu a pentagram(五角星 Ex8-
MATLAB Exercise 8 School of Mathematical Sciences Xiamen University http://gdjpkc.xmu.edu.cn Ex81 MATLAB Exercise 8 – Graphics Curve 1. Plot following 2D curve 1) 0.3 cos 2 , [0,6] x y e x x - = Œ ; 2) x = 4sin t, y = 4cost,t Œ[0, 2p ]; 3) 4 4 2 2 x + y -8x -10y +16 = 0 ; 4) r = 4cos3q . 2. Let , [0,10] 1 nx y x x = Œ + . 1) Set n =1,5,10respectively; display the corresponding curve 1 2 3 c ,c ,c at the same axes; 2) Use different color to distinguish the curves; 3) Legend the curves; 4) Add grid on the figure above; 5) Label the xaxis with ‘X轴’ and yaxis with ‘函数值’. 3. Add title for 4) in Ex1 with ‘Plot of r = 4cos3q ’. 4. Let 4 4 2 2 x + y - 2(x + y ) = b . 1) Plot 4 figures 1 2 3 4 c ,c ,c ,c with b=1.0, 0.7, 1.0, 1.05; 2) Partition the figure into 4 subplots, plot 1 2 3 4 c ,c ,c ,c into the subplots in turn. 5. Create 2 figures which plot the following 3D curves, respectively. 1) 2 3 x = 0.5t , y = 0.1t ,z = 9cos 2t,t Œ[0,6]; 2) x = 0.5sin t, y = 0.1cost,z = 9cos 2t,t Œ[0,9]. 6. Plot polylines(折线) with following data on the same axes. Distinguish them by color and line shape and legend them. 1) x = [0,1, 4,5,7], y = [1,3,4,5,5.6]; 2) x = [1, 2,3, 4,5], y = [2, 4,1,6,3]. 7. Let 1 ( ) 5 4cos f x x = + , 1 f (x) = f ¢(x) , 2 f (x) = f ¢¢(x) , 2 2 g(x) = f (x)d x ÚÚ . 1) Plot 1 2 f (x), f (x), f (x)respectively; 2) Observe the plots of f (x) and g(x) are the same? Break the Figure window into an 1by2 matrix of small axes, plot f (x) and g(x). 3) Let e be the error between f (x) and g(x). Display the function e and plot it. What do you find out? 8. *Plot three circles with the same center in one figure. 9. *Plot a pentagram(五角星)