14.+surface+plotting.pdf - TA Mahalakshmi Srinivasan...

This preview shows 1 out of 2 pages.

TA: Mahalakshmi Srinivasan [email protected] 1 HELP SURFACE PLOTTING Creating a 3D Object So far we’ve talked about plotting lines and shapes. Now we’re moving on to plotting surfaces. The first step to creating a surface is basically creating a grid of x and y values and then raising or lowering them (specifying a z value). We create a grid and then write a function defining z and plot x, y, and z. To create a grid, we use the function meshgrid(). The function takes in 2 vectors (x and y) and produces a grid that represents every possible combination of the two. For example: [xx yy] = meshgrid([1 2 3], [4 5 6 7]) xx ==> [1 2 3; 1 2 3; 1 2 3; 1 2 3] yy ==> [4 4 4; 5 5 5; 6 6 6; 7 7 7] Some things to note are that in xx each of the rows are identical and in yy each of the columns are identical. Also, x had a length of 3 and y had a length of 4 so the two arrays xx and yy are 4 x 3. We can then raise and lower them by specifying a function for zz.
Image of page 1

Subscribe to view the full document.

Image of page 2
You've reached the end of this preview.
  • Fall '08
  • rwr
  • xx yy zz, Mahalakshmi Srinivasan

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern