matlab code + output
8888888 Copy this code exactly as it is ... do not modify it if isunix() name = getenv ('USER') ; else name = getenv ('username'); end mytitle - [name ' : *(10000 rand (1,1))> 887.7889888 place it before the first line of your m-file Part A: Copy the following mandatory code and insert' after the header information of your scrip file. Part B: Create a vector x of values from 0 to 20, with a spacing of /10. Define vectors y and z as y=xcos(4x2) and zxcos(x/4). Use subplots to plot all the graphs. Place an adequate title for each curve using the following command: titta(['PUT YOUT TITLE HERE' mytitie]) a. Create an xy plot of x and y and add adequate title, x and y labels. b. Create a polar plot of x and y and add adequate title, x and y labels. c. Create a three-dimensional line plot of x,y and z with title and labels and add adequate title, x and y labels. d. Use comet3 and create another graph and add adequate title, x and y labels. (Note: x should be chosen such that the curves are smooth) Create x and y vectors from 12 to +12 with a spacing of 0.2 and use the meshgrid function to map x and y onto two new two-dimensional matrices called X and Y. Use your new matrices to calculate Z defined as follows: Z=6sin(0.2X2+0.6Y2) Use subplots to plot all the following graphs: Place an adequate title for each curve using the following command: title (['PUT YOUT TITLE HERE' mytitlel) ENGR 3032, Experiment \# 75 Term 442.2022 Page 2 of 3 a) Use the mesh plotting function to create a three-dimensional plot of Z and add adequate title, x and y labels. b) Use the surf plotting function to create a three-dimensional plot of Z and add adequate title, x and y labels. Compare the results you obtain with a single input ( Z) with those obtained with inputs for all three dimensions (X,Y,Z). c) Modify your surface plot with interpolated shading. Try using different colormaps and add adequate title, x and y labels. d) Generate a contour plot of Z and add adequate title, x and y labels. c) Generate a combination surface and contour plot of Z and add adequate title, x and y labels. (Note: include a screen shot of your scripts (showing the name of the m-file, the folder name and path. Include also the resulting fugures/plots)