Revision –Matlab

1) Evaluate

ceil(1.2) and floor(1.9)

Answer

2) Matlab can be used as a calculator, show the steps of evaluating

Answer

3) Matlab can be used as a calculator, show the steps of evaluating

Answer

4) Assume that

What is the output of the following commands?

Answer

5) Evaluate the expression

, x_{0}=2

For scalar: x =1

And for vector: [1; 1.5; 2; 2.5; 3]

Answer

6) Assume we have the following matrix

What are the results of the following expressions?

Answer

7) Draw and write the code of the following function

Answer

8) Write the code that generates the following plot

Answer

9) Write code to build a Car class with:

** position, velocity, **and

the **car** constructor, and

**accelerate** function that takes ** rate **and

Then construct an instance of the car class and accelerate it with ** rate
**= 5 and

Answer

10) Draw the Simulink model for the following mathematical system

Answer

11) Relation between Wavelength and Intensity

h is Planck's constant = 6.6261×10^{-34} J. s

c is speed of light = 2.9979×10^{8} m/s

k = Boltzmann's constant = 1.3807×10^{-23} J/K

wavelength range [1e-9, 3000e-9]

Write the code and plot the curve for:

T_{1} = 4500, T2 = 6000 T_{3} = 7500 K;

Answer