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

2nd assignmentMATLAB-_MEE1006

The document is an assignment for the MATLAB for Engineers course at Manipal University Jaipur, detailing tasks for students to complete by December 10, 2024. It includes ten questions that require students to write MATLAB code for various mathematical functions, matrix manipulations, plotting, and solving equations. Students are instructed to adhere to submission deadlines and formats as specified by their instructors.

Uploaded by

QuizMM Muj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

2nd assignmentMATLAB-_MEE1006

The document is an assignment for the MATLAB for Engineers course at Manipal University Jaipur, detailing tasks for students to complete by December 10, 2024. It includes ten questions that require students to write MATLAB code for various mathematical functions, matrix manipulations, plotting, and solving equations. Students are instructed to adhere to submission deadlines and formats as specified by their instructors.

Uploaded by

QuizMM Muj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MATLAB for Engineers (MEE1006)

I Semester, Session: 2024-25, B.Tech


Department of Mechanical Engineering, SAMM
Manipal University Jaipur

Assignment-2
(Release Date: 3rd Dec 2024; Due Date: 10th Dec 2024)

Instructions to the students:


i. Follow the deadline to submit the assignment (late submissions will lead to deduction in
marks).
ii. Mode (hard/soft copy) of submission is dependent on the respective course instructor(s).

Q.1 Write a MATLAB code using 𝑦 = 𝑥 2 − 1 to generate the plot of ‘𝑦’ shown in Figure 1 below.

Figure 1

Q.2 Suppose you have a matrix D of size 4 × 6 filled with consecutive integers starting from 1.
Create the matrix D in MATLAB and reshape matrix D into a 2 × 12 matrix. Write the code and its
output.

Q.3 Using the MATLAB built-in functions (zeros, ones, eye), create the following matrix

0 0 0 1 1
0 0 0 1 1
1 0 0 0 0
𝐴= 0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
[0 0 0 0 1]
1 2 3
Q.4 For the given matrix, A= [4 5 6] write the code and its output while perform the following
7 8 9
operations:
i) Delete first row of given matrix A
ii) Generate sub matrix B from given matrix A having any first and second rows
iii) Transpose of sub matrix B
iv) Calculate elemental square and square of matrix A

Page 1 of 2
Q.5 In MATLAB, plot the following functions in the same 2D plot within a range of [−2𝜋, 2𝜋].
Write the code and show its output.
(i) 𝑦1 = sin(𝑥)
(ii) 𝑦2 = cos(𝑥)
(iii)𝑦3 = tan(𝑥)
(iv) 𝑦4 = 𝑒 𝑥
(v) 𝑦5 = log(𝑥)

Q.6 Figure 2 shows the location of the centre of gravity of a 5000 N truck for the unloaded condition.
The location of the added load 𝑊𝐿 is at a distance of x inches behind the rear axle. Using MATLAB,
plot 𝑊𝐿 as a function of x, ranging from 0 to 60 mm with a step size of 0.05. Label the axis as 𝒙
(mm) and Load (N) and give the figure title as ‘Load vs Distance’.

Figure 2
From free body diagram, 𝑊𝐿 have been obtained as
5000
𝑊𝐿 =
60 + 𝑥
Q.7 Create an anonymous function in MATLAB named parabola that represents the equation
of a parabola. The parabola equation is given as:

𝑓(𝑥) = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐, where a=1.3, b=0.2, and c=30

Write MATLAB code to define the anonymous function parabola using these coefficients.
Then, use the function handle to evaluate the value of the parabola function at 𝑥 = 1. Redefine
this function by vectorizing the expression so that it can take array as an input. Create a vector
input 𝑥 ranging from -10 to 10 and generate a plot for this function. Write the code and show
its output.
Q.8 Write a MATLAB script to solve the following system of equations and write the code to verify
the solutions using symbolic substitutions:
𝑥 + 3𝑦 − 𝑧 = 2-------(1)
𝑥 − 𝑦 + 𝑧 = 3 -------(2)
3𝑥 − 5𝑦 = 4 -------(3)

Q.9 Using MATLAB differentiate, y(x) = 𝑒 −𝑥 sin⁡(𝑥) symbolically. Also obtain the value of
𝑦 ′ (𝜋/2). Write the code and its output.
𝑚 2
Q.10 Using MATLAB compute the indefinite integral ∫0 𝑒 −𝑥 sin⁡(𝑥) 𝑑𝑥 symbolically. Also
substitute ‘𝑚’ by ‘π’ and obtain the definite value. Write the code and its output.

Page 2 of 2

You might also like