ENGR1121 – Computing Applications in Mechanical Engineering
Lab 2D Arrays
Lab due: end of lab
Total points: 20
Labs are to be individual work. You may use MATLAB Marina, MATLAB’s help, and your notes. Lab work will be
graded during lab time and working results must be shown to the lab instructor by the end of the scheduled
lab time. All MATLAB programs and functions must be completed and submitted in accordance with the
Computing Assignment Format and the MATLAB Coding Style. Submit an electronic copy of your lab work to
the appropriate Dropbox Folder in GSU’s Folio by the end of lab. No hard copy needed unless specifically
requested by the instructor.
Grading
Each problem will be graded according to: program design (identifying inputs/givens, process, and outputs;
algorithm) and program style (program comments, variable names, proper formatted input and output
including units) 25%, and program correctness 75%.
Lab Work
1. (14 points) Type the following array and use MATLAB commands to answer the following questions
3 7 − 4 12
− 5 9 10 2
A=
6 13 8 11
15 5 4 1
a. Create a vector v consisting of the elements in the second column of A
b. Create a vector w consisting of the elements in the second row of A.
c. Create a 4 x 3 array B consisting of all elements in the second through fourth columns of A.
d. Create a 3 x 4 array C consisting of all elements in the second through fourth rows of A.
e. Create a 2 x 3 array D consisting of all elements in the first two rows and the last three columns of
A.
f. Find the maximum value in each column of A.
g. Find the maximum value in each row of A.
h. Find the maximum value in A.
i. Find the location (indices) of the maximum value in A.
j. Sort each column and store the result in an array E.
k. Sort each row and store the result in an array F.
l. Add the elements in each column and store the result in an array G.
m. Add the elements in each row and store the result in an array H.
n. Add all the elements in A.
2. (6 points) Download and load Amazon.com box dimension data from the file boxdata.mat. The box
dimension data is a N by 3 array with the first column containing the lengths in inches, the second column
the widths in inches, and the third column the heights in inches of standard Amazon.com shipping boxes.
a. (1 points) Determine the volume of each type of box.
b. (1 points) Determine and display the minimum, maximum, and average box volume.
c. (2 points) Determine and display the number of boxes with a volume greater than 50 in3 and a length
less than 10 in.
d. (2 points) Determine and display which boxes (the box numbers) an amorphous object (such as a bag
of gel) with volume 6550 in3 could be shipped in.
1
Instructor: Dr. Priya Goeser
Lab 2D Arrays
of 1
Report
Tell us what’s wrong with it:
Thanks, got it!
We will moderate it soon!
Struggling with your assignment and deadlines?
Let EduBirdie's experts assist you 24/7! Simply submit a form and tell us what you need help with.
Free up your schedule!
Our EduBirdie Experts Are Here for You 24/7! Just fill out a form and let us know how we can assist you.
Take 5 seconds to unlock
Enter your email below and get instant access to your document