Solve using matlab
And solve by hand
Q2)
Hand calculation:
MATLAB
Function script
function y=xplt(t)
y=((sin(2*pi*100*t))+(cos(2*pi*100*t)))
end
Main
script
clc;close all;clear all;
T=0.01
t=-T:T/500:T
x=xplt(t)
figure(1)
subplot(321)
plot(t,x,'linewidth',3)
xlabel('t');ylabel('x(t)')
title('x(t)')
subplot(322)
plot(t,xplt(-t),'g','linewidth',3)
xlabel('t');ylabel('x(-t)')
title('x(-t)')
xe=(xplt(t)+xplt(-t))/2
subplot(323)
plot(t,xe,'r','linewidth',3)
xlabel('t');ylabel('xe(t)')
title('Even part of x(t)')
xo=(xplt(t)-xplt(-t))/2
subplot(324)
plot(t,xo,'m','linewidth',3)
xlabel('t');ylabel('xo(t)')
title('Odd part of x(t)')
%from hand calculation
xe=cos(2*pi*100*t)
subplot(325)
plot(t,xe,'r','linewidth',3)
xlabel('t');ylabel('xe(t)')
title('Even part of x(t) from hand calculation')
xo=sin(2*pi*100*t)
subplot(326)
plot(t,xo,'m','linewidth',3)
xlabel('t');ylabel('xo(t)')
title('Odd part of x(t) from hand calculation')
Observation:
The results of hand calculations and the results provided by matlab both are same.
___________________________________________________________________________________
Q3)
MATLAB:
clc;close all; clear all;
t=0:0.1:3
h=ones(1,length(t))
x=(exp(-t)).*(t>=0)
subplot(231)
plot(t,x)
xlabel('t');ylabel('x(t)');title('x(t)')
subplot(232)
stem(t,h)
xlabel('t');ylabel('h(t)');title('h(t)')
m=0:0.1:6
y=conv(x,h)
subplot(233)
plot(m,y/10)
xlabel('t');ylabel('y(t)');title('y(t)')
k=0
for w=0:pi/500:pi
k=k+1
Xw(k)=trapz(t,x.*exp(-j*w*t))
end
w=0:pi/500:pi
subplot(234)
plot(w/pi,Xw)
xlabel('w');ylabel('|X(jw)|');title('X(jw)')
k=0
for w=0:pi/500:pi
k=k+1
Hw(k)=trapz(t,h.*exp(-j*w*t))
end
w=0:pi/500:pi
subplot(235)
plot(w/pi,Hw)
xlabel('w');ylabel('|H(jw)|');title('H(jw)')
Yw=Xw.*Hw
k=0
for m=0:0.1:6
k=k+1
yy(k)=trapz(w,Yw.*exp(j*w*m))
end
yy=yy/(2*pi)
m=0:0.1:6
subplot(236)
plot(m,yy)
xlabel('t');ylabel('y(t)');title('y(t) from inverse FT')
Solve using matlab And solve by hand b b had a) Corle (atoul itpeuts b b had a) Corle (atoul itpeuts
first solve by hand then using MATLAB and include the
code
3. (All students!) Find the exact solution to the problem 4x, x2 +2x 4 xi +x2 +4x3=-1 Now use MATLAB to solve this system iteratively, using the Jacobi iteration method.
3. (All students!) Find the exact solution to the problem 4x, x2 +2x 4 xi +x2 +4x3=-1 Now use MATLAB to solve this system iteratively, using the Jacobi iteration method.
*Please solve the problem a. and b. by hand
*Please solve the problem a. and b. by hand
For the following system of equations: -X1-3X2-??-10 2x1 x2 x3-8 2x1 a. (8 pts) Find the PLU factorization of the coefficients matrix, b. (8 pts) Solve the system using the PLU factorization. (2 pts) Compare your solution by hand to that obtained by MATLAB using the linsolve () function. d.
solve using matlab or by hand.
For the following differential equation, answer the questions. -y"+y=x (0.0 SX 35.0) y(0.0)=1.0, y(5.0)= 2.0 (1) Solve the differential equation analytically. (2) Solve the differential equation using centered finite difference approximation of y" with a step size of 1.0 and check the accuracy of the solutions.
PLEASE SOLVE IN MATLAB ! SOLVE IN MATLAB !SOLVE IN MATLAB !SOLVE
IN MATLAB !SOLVE IN MATLAB !
Question 4 [25pts]: Plot y[n] = cos(na) by using stem command. For the sake of visuality, take n from 0 to 30 with an increment of 1. Is the signal periodic? If so, please show its fundamental period from the plot.
Solve by using
(a) the most accurate combination of Trapezoidal and Simpson’s
rules.
(b) the MATLAB trapz function.
(c) the function trapuneq.
Using matlab solve the problem in the Q
Apply least squares fitting to derive the normal equations and solve for the coefficients by hand (using Cramer's rule) for the model y a1x + a2x2. Use the data below to evaluate the values of the coefficients. Also solve the normal equations in MATLAB (using backslash) and verify your hand calculations. Lastly, plot the data N) 25 70 380 SS0 points and the model in MATLAB and submit plot with handwork. (m/s)102 F. (N) 25 70 380550 610 1220 830...
Solve the following Using MATLAB. (Please show the coding
Script)
13. Solve Problem 13 Using MATLAB Given the unity feedback system of Figure P6.3 with G(S) = 5(56 – 233 - 5 + 253 + 432 – 85 - 4) tell how many closed-loop poles are located in the right half-plane, in the left half-plane, and on the jw-axis. (Section: 6.3) MATUA
Write the MatLab code and solve by hand as well.
Exercise: Consider the configuration of conductors and potentials shown in Figure 14.7. Write a MATLAB program that solves Laplace equation in the area bounded by the conductors. Plot the contours of the voltage and the lines of the electric field Gap Gap 50N Gap 50 V 2 c 2 cm 100 v 0 V o V 4 cm 0 V 4 cm Figure 14.7 The configuration of the exercise of...
Please solve this by using MATLAB thank you