Question

MATLAB only Use MATLAB to Plot the different representations of the Dirac Delta Function δ(x). Provide...

MATLAB only

Use MATLAB to Plot the different representations of the Dirac Delta Function δ(x). Provide FIGURES.

Homework Answers

Answer #1

Plot for different representations:

f1(blue), f2(red), f3(yellow), where functions are defined in MATLAB code below:

MATLAB Code:

x = linspace(-0.5,0.5,1000);
f1=zeros(1,1000);
f2=zeros(1,1000);
f3=zeros(1,1000);


e=0.04;
for i=1:1000
    if(x(i)>-e)&&(x(i)<e)
        f1(i)=1.0/(2.0*e);
    else
        f1(i)=0.0;
    end
end
plot(x,f1)

hold on;

e=0.001;
for i=1:1000
    f2(i)=exp(-(x(i)*x(i))/(2*e))/sqrt(2*pi*e);
end
plot(x,f2)

hold on


hold on;

e=0.001;
for i=1:1000
    f2(i)=exp(-abs(x(i))/e)/sqrt(2*e);
end
plot(x,f2)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write down the Fermi Dirac distribution function. Use Mathematica to plot the distribution function against energy...
Write down the Fermi Dirac distribution function. Use Mathematica to plot the distribution function against energy for 0K, 5K,10K, 20K, 40K, 80K, an 160K.
Use the Laplace transform to solve the following IVP y′′ +2y′ +2y=δ(t−5) ,y(0)=1,y′(0)=2, where δ(t) is...
Use the Laplace transform to solve the following IVP y′′ +2y′ +2y=δ(t−5) ,y(0)=1,y′(0)=2, where δ(t) is the Dirac delta function.
Using MATLAB Write a user-defined MATLAB function for the following math function: y(x)= (-0.2x^3 + 7x^2)e^-0.3x...
Using MATLAB Write a user-defined MATLAB function for the following math function: y(x)= (-0.2x^3 + 7x^2)e^-0.3x The input to the function is x and the output is y. Write the function such that x can be a vector (use element-by-element operations). (a) Use the function to calculate y(-1.5) and y(5). (b) Use the function to make a plot of the function y(x) for -2 ≤ x ≤ 6.
Write a MATLAB m file to plot the 3-D curve represented by a multivariable function z(x,y)...
Write a MATLAB m file to plot the 3-D curve represented by a multivariable function z(x,y) = x2 −0.5y2 over x ∈ [−2,2] and y ∈ [−2,2]. Use a 2 point thickness. For both x an y axes, choose the grid size to be 0.05. Clearly label and title your plot. Rotate the view at an azymuth of −20 , and elevation of 20 . You need to use the following commands: x=-2:0.05:2; y=x; z=x.^2-0.5*y.^2; plot3(x,y,z,’LineWidth’,2) label(’ My 3D curve’);...
Show all steps please Using Matlab: Generate a random signal ‘x’ with a length of 8000...
Show all steps please Using Matlab: Generate a random signal ‘x’ with a length of 8000 and sampling rate of 8kHz. Plot a section of the signal In the time domain. Is it possible to observe significant trends in the time domain signal? Plot the magnitude of the DFT of segments of ‘x’ of different lengths. Use a decibel scale for the vertical axis. What do you observe as the segment length increases? Use the Matlab function ‘periodogram’ to obtain...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5 3.4 2] a). Plot a scatter plot of the data b). Determine the coefficients of the polynomial ?0 + ?1? + ?2?2 which best fits the data c). Plot this function on the same plot as in part ‘a’. USE MATLAB CODE ONLY! USE MATLAB CODE ONLY! THANK YOU
2) (USE MATLAB) Create a function called g that satisfies the following criteria. (Hint: Find function)...
2) (USE MATLAB) Create a function called g that satisfies the following criteria. (Hint: Find function) For x < -π                    g(x) = -1 For x ≥ -π and x ≤ π    g(x) = cos(x) For x >π                      g(x) = -1 Plot your results for values of x from -2p to +2p. Choose your spacing to create a smooth curve.
**Please use MATLAB** 11)Function: Create a function that takes inputs “x” and “z” and generates any...
**Please use MATLAB** 11)Function: Create a function that takes inputs “x” and “z” and generates any random matrix of dimension “x” or “z”, whichever is larger. 12)Function: Create a function that takes a generic matrix, x, and finds the smallest value in the matrix. The function must work for matrices of any size or dimension. **Please use MATLAB** Also, please include code used for the function. I have tried several times but have been unsuccessful.
Write a Matlab program to plot the cosine wave. That is plot y=cos(k1x) vs. x for...
Write a Matlab program to plot the cosine wave. That is plot y=cos(k1x) vs. x for x varying from 0 to 2pi radians. The value of k1 is given at the end of this document. You can choose the increment for x. Note that large values of the increment will give you a coarse graph. Note: Matlab has two functions to calculate the sine of an angle: sin(x) and sind(x). What is the difference between these two functions? Use help...
You can use dsolve in MATLAB...run simplify(...) on the solution...You should plot the homogeneous and the...
You can use dsolve in MATLAB...run simplify(...) on the solution...You should plot the homogeneous and the inhomogeneous solutions on the same graph, using the "plot" function of MATLAB. set the arbitrary constants to 1 Consider the homogeneous equation y'' + 3y' + 2y = 0. a) Solve it and set the c's to 1. Graph this transient solution using large dots in MATLAB. b) Now add on the right-hand side the linear term 12x. Solve the inhomogeneous equation y'' +...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT