{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW1_Curtis_Ryan

# HW1_Curtis_Ryan - 10W-GV HW1 Curtis Ryan 1/4 Scholar HW1...

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

10W-GV 1/26/11 HW1 Curtis, Ryan 1/4 Scholar: HW1 Problem 1 Problem Statement: To develop a script file in MatLab that will compute volume and surface area after inputting a certain Diamter, height, and percentage of the diameter. Diagram: %This script file is used to determine the material volume and surface area %of a hollow cylinder. D = input( 'Enter the cylinder Diameter in feet: ' ); %D=Diameter H = input( 'Enter the cylinder height in feet: ' ); %H=Height S = input( 'Enter the percentage of the cylinders diameter: ' ); Small = (S/100)* D; %Percentage decided by hundred gives you the decimal and then is multiplied by the diameter Volume = (pi*((D/2)^2)*H)-(pi*((Small/2)^2))*H; %Volume of the Large cylinder minus the volume of the inside Surfacearea = ((((D/2)^2)*pi)-(((Small/2)^2)*pi))*2 + (D*pi)*H +(Small*pi*H); %Circumference*height of both diameters added together. Area of the large cylinder minus the small cylinder multiplied by two fprintf ( 'Volume = %0.1f ft^3 \n' , Volume) %Will output the volume in cubic feet fprintf ( 'Surface Area = %0.1f ft^2 \n' , Surfacearea) %Will output the

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