HW1_Curtis_Ryan

HW1_Curtis_Ryan - 10W-GV 1/26/11 HW1 Curtis, Ryan 1/4...

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

View Full Document Right Arrow Icon
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)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

HW1_Curtis_Ryan - 10W-GV 1/26/11 HW1 Curtis, Ryan 1/4...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online