CMPSC 200 – Lab 3
Description
Objectives:
1. Use MATLAB to perform engineering calculations.
2. Apply scripts, functions, and local functions to an engineering problem.
Description:
You have a steel plate with thickness 𝒕 and side lengths 𝑳𝟏& 𝑳𝟐. It has holes of diameter 𝒅 drilled in a
rectangular pattern with spacing 𝒔, as shown below. In such a scenario it is important to know the final
volume and surface area of the part. Volume is needed so that the weight can be predicted, while
surface area is needed so that surface treatments can be planned.
Deliverables:
Based on a set of given information provided in a script, the student must:
• Define 2 local functions for the script.
o To perform a unit conversion.
o To determine the number of holes required based on the size of the plate, holes, and
required spacing
• Define a single function that outputs the surface area and volume of the resulting metal sheet.
dHole + space
dHole + space
Instructions:
1. Open MATLAB and Canvas, download the required file for Lab 03, and place it in your working
folder.
2. Open the script and follow the instructions given in the comments.
3. You should not use global variables in today’s lab.
4. (8 pts) Be sure to replace the instructional comments with your own comments after you
complete each step.
5. (7 pts) Be sure to use good naming conventions for any variables you define.
6. (5 pts) After you are finished and you have confirmed your results for the preset dimensions,
change the values given for the sheet dimensions to reflect this sheet: Steel Sheet when it has
holes drilled in it with a 𝟒 𝒎𝒎 drill bit and the holes are spaced 𝟏 𝒎𝒎 apart.
7. When you are done, you should have the script that you were provided (heavily modified now)
and the AreaVolume function that you created. Highlight both files in the MATLAB current folder
window (you can select both by holding Ctrl when you click on them), then right-click and select
“Create Zip File.” Name the zip file with LAB03_psu123.zip, replacing psu123 with your Penn
State email ID#.
8. Upload the zip file to Canvas.