Borrar filtros
Borrar filtros

how to use exp for this problem

2 visualizaciones (últimos 30 días)
Ashutosh
Ashutosh el 21 de Sept. de 2022
Comentada: Walter Roberson el 21 de Sept. de 2022
i=1;
Un=3;
sd=1.41;
w=exp(-[[i-Un]^2]/2[sd]^2)

Respuestas (1)

James Tursa
James Tursa el 21 de Sept. de 2022
You need to use the * operator to multiply in the denominator. E.g.,
w=exp(-(i-Un)^2/(2*sd^2))
If i is not a variable defined by you, it will be interpreted as the imaginary number sqrt(-1).
  1 comentario
Walter Roberson
Walter Roberson el 21 de Sept. de 2022
I would recommend
w = exp(-(i-Un).^2./(2*sd.^2));
as that would be able to work on non-scalars as well.

Iniciar sesión para comentar.

Categorías

Más información sobre Exponents and Logarithms 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