Sheet 2
t =linspace(0,2*pi,200);
v= 5.*exp(2.*t).*sin(1000.*pi.*t);
plot(t,v)
xlabel('time')
ylabel('voltage')
title('RLC circuit ')
2.1 Plot the voltage across a parallel RLC circuit given as
v (t) = 5e2t
sin(1000πt)
Sheet 2
r=1.2; thet=15*pi/180;
ang=0:thet:20*thet;
magn=r.^(ang./thet);
polar(ang,magn)
2.2 Obtain the polar plot of z=r−n
ejnθ
for θ = 15o
and n = 1 to 20.
Sheet 2
Ans.
x=linspace(-4,4,200); p=[1 3 4 2 6]; y=polyval(p,x);
plot(x,y)
r=roots(p)
r =
-1.7749 + 1.2310i
-1.7749 - 1.2310i
0.2749 + 1.1002i
0.2749 - 1.1002i
2.3 A function f (x) is given as
f(x)=x4
+3x3
+4x2
+2x+6
(a) Plot f (x) and (b) Find the roots of f (x)
Sheet 2
clear all
t=0:0.01*pi:4*pi;
m=4*cos(120*pi*t) +2*cos(240*pi*t);
c=10*cos(10000*pi*t );
s=m.*c;
figure
subplot(3,1,1);
plot(t,m)
ylabel('M')
subplot(3,1,2);
plot(t,c)
ylabel('C')
xlabel('t')
subplot(3,1,3);
plot(t,s)
ylabel('S')
2.4 A message signal m (t) and the carrier signal c(t) of acommunication system are,
respectively:
M (t) = 4 cos (120πt) +2 cos(240πt ) and c(t) =10 cos(10,000πt )
A double-sideband suppressed carrier s (t) is given as
s (t) = m(t)c(t)
Plot m (t), c (t) and s (t) using the subplot command.
Sheet 2
v=0:.001:.6;
i=1e-14*exp(v/(2*26e-3));
plot(v,i,'-B','linewidth',2)
xlabel('voltage (V)')
ylabel('current (A)')
title('Diode current')
2.5The voltage v and current I of a certain diode are related by the
expression
i =Isexp[ v/ (nVT )]
If Is = 1.0x10−14
A, n = 2.0 and VT = 26 mV, plot the currentversus
voltage curve of the diode for diode voltage between 0 and 0.6volts.
Sheet 2
X=500:2000; l=0.2;c=2e-6;
F=(1/2*pi)*sqrt(l*c*((c*X.^2)-l)./((c*1500^2)-l));
F1=(1/2*pi)*sqrt(l*c*((c*1500^2)-l)./((c*X.^2)-l));
plot(X,F1,':b')
hold on
plot(X,F,'--r')
xlabel('R (ohm)')
ylabel('F (HZ)')
title('The resonant frequency'); hold off
NAME: Ahmed El-morsy Abdel-hamid
Sec: 1
about me :)
THANK YOU 
2.6The resonant frequency f (in Hz) for the circuit shown is given by:

Sheet 2