MATLAB Course Assignment (1)
MATLAB Course Assignment (1)
Instructions:
• Submit your MATLAB scripts and a brief report explaining your solutions.
1. Introduction to MATLAB:
2. Key Terminologies:
▪ Variable
▪ Array
▪ Function
▪ Script
▪ Matrix
3. Operators in MATLAB:
4. Debugging:
1. Basic Operations:
4. Multiply the row vector by the column vector and display the result.
5. Extract the second row of the 3x3 matrix and display it.
3. Functions:
3. In the main script, prompt the user to input the radius and display the
calculated area using the function.
4. Matrix Operations:
o Given two matrices A = [1, 2; 3, 4] and B = [5, 6; 7, 8], perform the following:
1. Matrix addition
2. Matrix multiplication
3. Element-wise multiplication
(a). Use the three vector in a MATLAB command to create a 3×5 matrix such that the
first, second, and third rows consist of the first three elements of the vector a, b and
c respective
6. Draw a Circle
Write a MATLAB script that draws a circle with a given radius. The user should be
prompted to input the radius of the circle and the coordinates of its center. Your
script should:
2. Plot the circle on a graph with a grid, labeled axes, and a title that includes
the radius of the circle.
3. Ensure that the aspect ratio of the plot is set to equal, so the circle is not
distorted.
Bonus: Allow the user to draw multiple circles by repeating the input process until
they choose to exit.