Matlab Assignment
Matlab Assignment
Class: K2
Reg No: 23FE10CAI00544
Q1: Q1. Calculate the area and circumference of a circle with a radius of 4 cm. Write set of commands
used at command prompt in MATAB. Submit screenshot of MATLAB commands and answer.
Q2: Q2. In MATLAB create two variables: a = 4 and b = 17.2. Now use MATLAB to perform the following
set of calculations. Submit screenshot of MATLAB commands at command prompt and answer- (A)- 5a
(B)-(b+9.8)1/3 (c)-10(5a+16)1/2
Q3: Q3. Calculate for the products AB, AC, BC, BA, CA and ACT , if these are defined. Submit screenshot
of MATLAB commands at command prompt and answer.
Q4. Calculate (BC) · (−AD + 3D) for Submit screenshot of MATLAB commands at command prompt and
answer.
Q5. Calculate the area and circumference of a circle with a radius of 4 cm. Write Script File in MATAB.
Submit MATLAB script file and screenshot of answer.
Q6. Create a new script file called SphereScript.m that will compute and display the surface area and the
volume of a sphere. Submit MATLAB script file and screenshot of answer.
Q7. Submit MATLAB script file and screenshot of answer.
(a). Use the Newton's law of universal gravitation to find the force exerted by the Earth on the Moon,
assuming that the mass of the Earth is approximately 6 * 1024 kg. the mass of the Moon is
approximately 7.4 * 1022 kg. and the Earth and the Moon are in the average of 3.9 * 105 m apart.
b) We know that the Earth and the Moon are not always the same distance apart. Find the force the
Moon exerts on the Earth for 10 distances between 3.8 * 108 m and 4.0 * 108 m. Plot the graph
between the distance and the force exerted.