ENGR112 Lab10 Surfaces.docx - Week 10 Name George...

This preview shows page 1 - 4 out of 13 pages.

Week 10 ENGR 112 In lab exercise Name: George Villanueva Lab Time: W 1600 People Worked With: Websites Used: Time spent on zyBooks (hrs): 1 Time spent on lab (hrs): 3 Submission Instructions Turn all work in to Lab 10 on Gradescope (PDF) and Canvas (.zip file), even if it is not complete yet. If you are not finished, complete the assignment outside of lab and re-submit to Lab 10 on Gradescope and Canvas. All labs are typically due at the same time on Monday every week, but check Canvas if in doubt. Learning objectives: Making and plotting surfaces Plotting in 3D New MATLAB commands These are highlighted in bold in the instructions below. surf( xs, ys, zs, ‘FaceColor’, [0.5, 0.5, 0.5], ‘EdgeColor’, ‘none’) Make a surface. FaceColor and EdgeColor are optional. Color is red, green, blue from 0 to 1 camlight left; lighting phong; - add light and nice shading alpha(0.2); - make the surface transparent. Parameter is 0-1 from less to more transparent sign(x) – returns 1 if x is positive, -1 if x is negative, 0 if x is zero
Week 10 ENGR 112 In lab exercise Lab Problems Files to download to your Lab 10 Folder DataFiles.zip unzip them to get srfX.txt etc Getting Started Anything for experimentation goes here with bullet points Do this o [X, Y, Z] = sphere(); o surf( X,Y,Z ); o axis equal Look at picture than do o [X, Y, Z] = cylinder(); o surf(X,Y,Z); o axis equal o Then do o [X, Y, Z] = cylinder( [1 0.2 1] ); o surf(X,Y,Z) o axis equal o And look at picture Make sure you can read in the data files from DataFiles.zip o X = dlmread( ‘srfX.txt’) same for Y and Z o surf(X,Y,Z) o axis equal o
Week 10 ENGR 112 In lab exercise Problem 1 Make a surface of revolution and plot/draw it Deliverables: 1. Script that does the surface creation and plotting 2. Figure showing the profile curve and the surface Step by Step Instructions : Create a function for the profile curve. If you don’t want to the surface to “pinch” in the middle then make sure your function is always positive. o The t values can be anything (zero to one, -1 to 1, 0 to 2 pi, etc) o Plot the function You can create values and plot, or use fplot – whatever you want Now create the surface of revolution o [X,Y,Z] = cylinder( ys ) ys has to be an array of values, not a function i.e., if you made an anonymous function, evaluate it to get an array ys = YourFunction( t values ) Make sure you use the same t value range you used in the profile curve

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture