MATLAB script hw

# MATLAB script hw - Crn 50 hw15 hanger jane Tuesday 3:28 PM...

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

MATLAB poolnoodle_script 1. % poolnoodle_script.m % This script will return the surface area (SA) of a pool noodle % and the volume (volume) of a pool noodle % after is uses the given width of an edge (W), the length (L), and diameter of hole (d) % call statement: poolnoodle_script W = 1.375; L = 8; d = 0.5; csa = 6*((1/2)*W*(W*sind(60)))-(pi*(d^2/4)); SA = 2*(csa)+(pi*d*L)+6*(W*L) volume = csa * L >> poolnoodle_script SA = 87.9976 volume = 37.7251 Crn 50, hw15, hanger, jane Tuesday, July 26, 2011 3:28 PM homework15 Page 1

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

View Full Document
MATLAB wedge_script 2. % wedge_script.m % This script will return the surface area (SA) of a cylindrical wedge % and the volume (volume) of a cylindrical wedge % when it receieves the radius of the whole cylinder (R), the height (H), and number of wedges (N) % call statement: wedge_script R = input('Enter the radius of the cylinder in inches, radius: '); H = input('Enter the height of the cylinder in inches, height: '); N = input('Enter the number of radially equal wedges the cylinder is cut, N: '); Area_base = (pi*R^2)/N; Lat_Area = (2*pi*R*H)/N; Lat_Rect = R*H; SA = 2*Area_base + Lat_Area + 2*Lat_Rect; Volume = Area_base * H; fprintf('\n For a cylinder with a radius = %f inches, height = %f inches , and in N = %f wedges \n', R, H, N) fprintf('\n The surface area of the cylindrical wedge = %f square inches.\n',SA)
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/13/2011 for the course EGR 1434 taught by Professor Spangler during the Summer '11 term at Virginia Tech.

### Page1 / 5

MATLAB script hw - Crn 50 hw15 hanger jane Tuesday 3:28 PM...

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

View Full Document
Ask a homework question - tutors are online