0% found this document useful (0 votes)
35 views3 pages

Sheet-01 EPM486

Uploaded by

highman6000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views3 pages

Sheet-01 EPM486

Uploaded by

highman6000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Sheet 1

Basic Principles for Arrays & Graph Plotting

(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

Saturday Sunday Monday Tuesday Wednesday Thursday Friday


DAY (1) DAY (2) DAY (3) DAY (4) DAY (5) DAY (6) DAY (7)
25 26 23 25 25 29 27

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.

(5) The volume of a cylinder is given by the relation V= π . r2 . h


where r : radius of base h : hight
if we have a cylinder of 15m hight and 8mradius of base, and want to install a new
cylinder of volume capacity 20% over the volume of old one, with the same hight.
Use the MATLAB to get the new radius of base.

(6) A current I passing through an electrical resistor having a voltage V across it is


given by Ohm’s law I = V / R where R is the resistance. The power dissipated in
the resistor is given by P = V2 / R. the following table gives data for the resistance
and voltage for five resistors. Use the MATLAB and the given data to get
(a) The current passing through each resistor
(b) The power dissipated in each resistor.

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

Table (1) : Product cost


Unit cost ($ * 1000)
Product Material Labor Transportation
1 6 2 1
2 2 5 4
3 4 3 2
4 9 7 3

Table (2) : Quarterly production volume


Product Quarter 1 Quarter 2 Quarter 3 Quarter 4
1 10 12 13 15
2 8 7 6 4
3 12 10 13 9
4 6 4 11 5

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy