{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW6_Campos_Tyler - 14W-CF HW6 Campos Tyler Wednesday 1:12...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Scholar: HW6 Problem 1 Problem: Prepare an algorithm to determine the surface area and volume of a single right circular cone for given values of height and diameter. Write the MATLAB function for your algorithm. Diagram: Solution: Flowchart Start Identify variables (height,diameter) R=d/2 SA=(pi*r*sqrt(r^2 + h^2)) + (pi+r^2) Vol=(1/3)*pi*(r^2)*h Input Height and diameter (h,d) End Output: Surface Area Volume of cone 14W-CF 02/23/2011 HW6 Campos, Tyler 1/5 Wednesday, February 23, 2011 1:12 PM HW6 Page 1
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
MATLAB Code: function [ SA,Vol ] = hw6q1( h,d ) %Surface Area and volume of a cone % Using the derived equations, the inputs of diameter and height will yield outputs of Surface % area and volume. r = d / 2; SA=(pi*r*sqrt(r^2 + h^2)) + (pi+r^2); Vol=(1/3)*pi*(r^2)*h; end Sample Run: >> [SA, Vol]=hw6q1(pi,5) SA = 40.9247 Vol = 20.5617 Discussion: This function was very simple to write and is much easier than the code we used in the past. Virtually no complications. 14W-CF 02/23/2011 HW6 Campos, Tyler 2/5 Wednesday, February 23, 2011 1:13 PM HW6 Page 2
Image of page 2
Scholar: HW6 Problem 2 Problem:
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ 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