ENGR1121 – Computing Applications in Mechanical Engineering
Lab Introduction to MATLAB
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
Use the following naming scheme for your programs: yourlastnameballthrownup.m and so on.
Use the following naming scheme for your folder and zip file: yourlastnamelab11 and so on.
Format, format, format…is the key to proper programming!
Use relevant descriptive texts along with the input and disp commands.
1. (4 points) After a hard work week, Kirk is driving to Helen, Georgia, for a tubing trip (to cool off). Kirk drives
200 miles north from his home to Timbuktu; he then turns right and travels 400 miles east to Helen. Write
a MATLAB program (.m file) to compute the linear distance, d, from Kirk’s home to Helen, Georgia.
Note: the linear distance is the distance of the direct path between the two cities, not the total distance
Kirk drove.
Execute (run) the above program using the green arrow run button on the editor dashboard.
Execute (run) the above program directly from the command window using the file name.
Check the formatting of the header by typing help filename on the command window.
2. (5 points) Write a MATLAB program that asks the user to input 5 numbers one at a time, calculates the
average of the numbers and displays it. Useful MATLAB commands: input, disp, mean
3. (5 points) Write a MATLAB program that asks the user to input an angle and verifies the trigonometric
identity: 𝑠𝑠𝑠𝑠𝑠𝑠∅2 + 𝑐𝑐𝑐𝑐𝑐𝑐∅2 = 1
4. (6 points) A ball is thrown straight up in the air with an initial speed of 25 m/s. Write a MATLAB program
that determines
a. the time tp it takes the ball to reach its highest point and
b. the highest distance sp the ball reaches from the release point.
Hint: The acceleration due to gravity is g = -9.8 m/s2 and useful formulae for projectile motion are:
v= v0 + at and s = s0 + v0t + 12 at 2 .
Use disp command to display the time tp and height sp appropriately.
1
Instructor: Dr. Priya Goeser
Lab Introduction to MATLAB
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