Revision –Matlab

1) Evaluate

ceil(1.2)   and  floor(1.9)

Answer

Description: F:\FCI\course\sci_matlab\MATLAB\04-1.jpg

 

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

 ,   x0=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 lanes properties,

the car constructor, and

accelerate function that takes rate and time

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

 

Answer



 

10) Draw the Simulink model for the following mathematical system

Answer

SIMULINK-01-Introduction


11) Relation between Wavelength and Intensity

 

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

c is speed of light = 2.9979×108 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:

T1 = 4500, T2 = 6000 T3 = 7500 K;

 

Answer

Max Plank

View Site Visitors