0% found this document useful (0 votes)
68 views

MatLab Exam 1 Problem Portion Feb 29 2024-1

Uploaded by

gerardoruiz1528
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

MatLab Exam 1 Problem Portion Feb 29 2024-1

Uploaded by

gerardoruiz1528
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name: _____________________ W#: _____________________

MatLab Exam #1
February 29, 2024
ENGR 2304-18842
6:00 – 7:50 pm

For this part of the exam, you need to solve the problems USING MATLAB [not your
eyeballs, not your calculator]. No references except what is in CANVAS that DOES
NOT OPEN IN A BROWSER WINDOW and what is in the MatLab help file. Calculator
allowed. You may write on this paper. You must use the classroom computers.

Your name and W# above indicate that the work here is entirely your own, that you
neither gave nor received help, and that you abided fully with the HCC Code of
Conduct.

Before the time expires on the exam at 7:55 pm, you need to turn in the script files
you created to the Module called MatLab Exam 1 – Modules 1, 2, 3 – Feb 20. There
is an assignment called MatLab Exam #1 – submit files HERE. The exam ends at
7:55 pm. Once the clock says 7:55 pm, you will not be able to submit.

All script files must follow the accepted format used in class with proper
commenting, the results copied/pasted into the script file, NO Semicolon that
suppresses the output in the command window, all variables are named [no use of
the default variable ans allowed], output identified using either DISP or FPRINTF,
graphs labelled with title and axes, etc.

1
%INFORMATION.
%VARIABLES.
%INPUT.
%PROCESS/ALGORITHM/CALCULATIONS.
%OUTPUT.
%RESULTS. Copy/paste results.
If these instructions are not followed, then half of the points of that problem will be
deducted.

Files should be saved as LastName_FirstName_MExam1_Pxx where


xx is the problem number.

Scoring:

P1: 20 points possible

P2: 25 points possible

P3: 15 points possible

Extra Credit P4: 10 points possible

From the paper portion: 40 points possible

Extra Credit paper portion: 3 points possible

Total score: 100 points plus 13 points Extra Credit

2
P1. 20 points. Create a script file to solve the following problem. Solve the
following system of linear equations. You must use the method of multiplying by
the inverse and the method of left division. You must check your work.

Save as LastName_FirstName_MExam1_P1.

P2. 25 points. Create a script file to solve the following problem. A chemical
plant releases an amount A of a pollutant into a stream. The maximum
concentration C of the pollutant at a point which is a distance x from the plant is:

𝐴𝐴 2
𝐶𝐶 = �
𝑥𝑥 𝜋𝜋 ⋅ 𝑒𝑒

Create variables as follows:


A = 0.05

x = [0.5, 1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 500, 1000, 5000, 10000,
50000, 100000]

and then calculate the maximum concentration.

Using FPRINTF and/or DISP to display the values for A, x and C.

Then plot C as a function of x. Put a title on the graph. Label the axes. Put a grid
on the graph. Make a decision as to whether to use a rectilinear graph of some sort
or a logarithmic graph – your choice. In the %RESULTS section describe what
happens to A as x increases and why you chose the type of graph you did.

Save as LastName_FirstName_MExam1_P2.

3
P3. 15 points.
Create a script file to solve the following problem. Implement the Law of Cosines.
Inputs are side lengths a, b, and c. Outputs are the measures of angles A, B and C
in degrees. Round to the nearest tenth [1 decimal place]. Check each solution – the
sum of the angles in a triangle should sum to 180 degrees.

Test using the following 4 cases:


a=17, b=15, c=13
a=5, b=5, c=5
a=12, b=16, c=20
a=18, b=24, c=30

Note that in the last equation cos(c) should be cos(C) – cos ( capital C ).

Save as LastName_FirstName_MExam1_P3

P4. Extra credit. 10 points possible. It is entirely up to Prof Keller to decide


how much, if any, extra credit to award. Generally the problem must be entirely
correct to receive extra credit.

Create a script file to solve the following problem. Plot f(x)=sin(x) and g(x)=cos(x) and
h(x)=tan(x) on the same graph. Label the x-axis as Angle in Degrees and choose an
appropriate label for the y-axis. Put a title on your graph. Use a grid. Plot from 0 to 720
degrees using a fine enough increment to have a smooth curve.

Save as LastName_FirstName_MExam1_P4

You might also like