Borrar filtros
Borrar filtros

Question about (exponential functions)*(delta function) and draw plots

1 visualización (últimos 30 días)
Chris Lin
Chris Lin el 30 de Jul. de 2021
Editada: Lucien Hollins el 30 de Jul. de 2021
I want to use matlab to draw a graph of y=e^(alxl+b)*delta function. And enter different values ​​of a and b to see how this graph looks like, what should I do? Thanks!
Note delta function:

Respuestas (1)

Lucien Hollins
Lucien Hollins el 30 de Jul. de 2021
Editada: Lucien Hollins el 30 de Jul. de 2021
Hi I understand you would like help with plotting the delta function.
As you mentioned in your question, the delta function returns inf when x = 0 and 0 for every other value of x. This will result in your function returning something like
y = Inf 0 0 0 0 0 0 0 0 0
regardless of what values you choose for a and b. However, I think you may be interested in using a stem plot to view your function as a series of impulses.
a = linspace(.01,.5,10);
b = linspace(.2,2,10);
x = 1:1:length(a);
y = exp(a.*abs(x)+b);
stem(x,y)
Here, I have arbitrarily assigned 10 values to a and b; however, you can specify any equal-sized vectors for these variables.
If you have access to the Symbolic Math toolbox, you may find these other options helpful:

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by