Mechatronics Engineering Department
Faculty of Engineering
Philadelphia University
Programming Lab. For Mechatronics (0640221)
Report (1)
Problem (1):
Use MATLAB to calculate:
1) 1.3𝑥 − 7(𝑦)1/2 𝑙𝑜𝑔 (10𝑥 ) , 𝑥 = 3, 𝑦 = 4
3 1/2
√−8+𝑒 −𝑥
2)
5∗𝑖
3) sin−1 0.5
Problem (2):
The car moves in straight line such that for a short time it position is defined as 𝒕𝟒 − 𝟑. 𝟑𝒕𝟑 −
𝟕. 𝟕𝒕𝟐 − 𝟑. 𝟗𝒕 (km), velocity v(t) = 𝟒𝒕𝟑 − 𝟗. 𝟗𝒕𝟐 − 𝟏𝟓. 𝟒 𝒕 − 𝟑. 𝟗 km/min and the acceleration
a(t) = 𝟏𝟐𝒕𝟐 − 𝟏𝟗. 𝟖 𝒕 − 𝟏𝟓. 𝟒 km/min2 where )t( is in second. Write a MATLAB command(s)
to calculate the time that required reaching the oil station if the station is 0.5 km far away. Then
calculate the velocity and the acceleration.
Figure 1
Problem (3):
Write a MATLAB script file to plot the three functions in Problem (3) in one figure as shown in
Fig 1 then added: the labels for x-axis & y-axis, the name of each line and legend. Then plot each
function a lone as shown in Fig2 using subplot command.
Note: The time interval (0-10) minutes.
Car Moves in Straight Line
80
position
70 Velocity
Acceleration
60
50 write your name here
40
Amplitude
30
acceleration
20
Velocity position
10
-10
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (Seconds)
Figure 2
Figure 3
Problem (4):
Write a MATLAB script file to calculate the values of the (x,y, and z) for the following 3*3
linear algebraic equation . Where the inputs are 𝑎1−3 , 𝑏1−3 , 𝑐1−3 , 𝑎𝑛𝑑 𝑞1−3 𝑎𝑠 𝑣𝑒𝑐𝑡𝑜𝑟𝑠.
𝑂𝑟𝑔𝑖𝑛𝑎𝑙 𝑓𝑜𝑟𝑚 𝑜𝑓 𝑒𝑞𝑎𝑡𝑖𝑜𝑛𝑠 ∶
𝑎1 𝑥 + 𝑏1 𝑦 + 𝑐1 𝑧 = 𝑞1
𝑎2 𝑥 + 𝑏2 𝑦 + 𝑐2 𝑧 = 𝑞2
𝑎3 𝑥 + 𝑏3 𝑦 + 𝑐3 𝑧 = 𝑞3
Try the code by entering different values of vectors.
Problem (5):
Write a MATLAB script file that let the user to enter his birthday date then calculate her age by
Seconds
Hours
Days
Note: Birthday date: day, month, year
GOOD LUCK