{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW6_Campos_Tyler

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

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

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

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

View Full Document
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
Scholar: HW6 Problem 2 Problem:

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern