Sheet-01 EPM486
Sheet-01 EPM486
(1) Write down the output appeared on the command window when performing
the following orders.
>>s=[10:-2:0],
>>s1=s.^2
>>y=[1 2 3;4 5 6;7 8 9],
>>z1=sum(y) , z2=sum(s)
>>z=mean(z2)*mean(z1)
>>a=100*sin(30*s*pi/180)
>>c=max(size(s))
>>b=[1:c]
(2) Write down the output appeared on the command window when performing
the following orders.
>>a=[1:0.5:3]
>>b=[3:-0.5:1];
>>c=[a;b]
>>int=trapz(a,b)
>>x=a
>>x(3)=[],xs=sum(x)
>>y=b
>>y(3)=[],ya=mean(x)
>>Ab=xs*ya*a
>>Ac=xs*ya*int
(3) Write down the output appeared on the command window when performing
the following orders.
>>t=[0:4]
>>y=t+4*t.^2-5
>>p=polyfit(t,y,3)
>>y1=polyval(p,[1.2,1.5])
>>pd=polyder(p)
>>a=trapz(t,y)
(4) The following table shows the temperature in Cairo through one week
1
Use the MATLAB orders to get the maximum temperature and what is the number of
the day at which the temperate is maximum, and also get the minimum temperature
and the number of day at which the temperature in minimum.
1 2 3 4 5
R (Ohms) 104 2 * 104 3.5*104 105 2 * 105
V (Volts) 120 80 110 200 350
(7) Table (1) shows the costs associated with a certain product and table (2) shows the
production volume for the four quarters of the business year . Use MATLAB to
(a) Find the quarterly costs for material, labor and transportation.
(b) The total material, labor and transportation costs for the year
(c) The total quarterly costs
2
(8) The following functions describe the oscillations in electrical circuits and
the vibrations of machines and structures. Plot these functions on the same
plot. Because they are similar, decide how best to plot and label them to
avoid confusion.
x (t) = 10 e-0.5 t sin (3t + 2)
y (t) = 7 e-0.4 t cos (5t – 3)
(9) The following table shows the average temperature for each year in a
certain city. Plot the data as a stem plot, a bar plot and a stairs plot.
Year 1990 1991 1992 1993 1994
Temp. 18 19 21 17 20
(10) Use the hold command and the plot command twice to plot
y = sin (x) and y = x – x3 / 3
On the same plot for x changes from 0 to 1, use different types of lines and do all
the available plotting features (labels, title, legend, text,……)
(11) Pick a suitable spacing of t and v and use the subplot command to plot the first
function z = e-0.5t cos (20 t – 6) for t changes from 0 to 8 and the second
function u = 6 log10 (v2 + 20) for v changes from –8 to 8. Label each axis.