Question Bank
Question Bank
Matlab Programming_2024-2025
1. If 𝑝 = 𝑥 4 − 12𝑥 3 + 25𝑥 + 116 and 𝑟 = 𝑥 + 1, find 2 from 3:
a. The roots of a polynomial 𝑝
b. Multiply the two polynomials 𝑝𝑟
c. The differentiation of the a polynomial 𝑝
2. Write two ways to display the following matrix:
3 4 5 6 7
( )
13 14 15 16 17
3. What is the output of the following code? t=0:0.001*pi:pi/2;
plot(t,sin(t),*);
4. Using the Matlab built-in functions (zeros, ones, eye) from the
0 0 0 1 1
0 0 0 1 1
1 0 0 0 0
following matrix: 0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
(0 0 0 0 1 )
5. Give Matlab commands to plot on the same figure the two functions:
𝑓 = 3𝑡 2 + 2𝑡 − 0.5
Where the variable t varies from 0 to 10 in step of 0.5 without need to
care about the dimension of t.
-Draw the function f in red dashdot style and the function g in green
star.
-Give title to your graph and label the axes, and adds grid line to your
plot.
6. What is the size and length of x?
−10 −11 −12 −13 −14 −15
x= ( )
−2 −1 0 1 2 3
7. Write the Matlab command for the following line:
𝑌 = |𝑋𝑒 𝑎𝑋 − cos 𝑏𝑋 | for a=11, b=π and X={2,4,6,8} without need to
care about the dimension of X.
8. Find the integral or the area under a function if 𝑥 is varied from 0 to
100 in steps of 1, and
𝑦 = 30 − 60 cos(2𝜋/100𝑥)
9. Find: (1) the inverse of matrix A, and (2) delete the second column of
matrix A.
10. Use the “for” loop comment to find the 𝑥 array if:
𝑥 = 2 ÷ 3√(𝑚𝑛)2 , where m is varied between 1 to 10, while n is
varied between 1 to 5, and ÷ (right divide).
S = ½ + ¼ + … +1/n
20. Calculate the average from 25 exam scores using the Flowchart.
21. Draw a Flowchart to Find Square of an Integer Number.
22. Draw a flowchart to calculate the area of a triangle.
23. Calculate the average of 5-numbers using the Algorithm and the
Flowchart.
24. Draw the Flowchart to find the sum of first of first 50 natural
numbers.
25. Find the largest among three different numbers entered by the
user using algorithm and Flowchart.
31. Find the area of the triangle where the three sides are given using
algorithm, flowchart and Matlab program.
32. Find the area and perimeter of the square using algorithm,
flowchart and Matlab program.