Borrar filtros
Borrar filtros

Function, How to write this formula in Matlab

1 visualización (últimos 30 días)
Santiago
Santiago el 6 de En. de 2022
Comentada: Walter Roberson el 6 de En. de 2022
I have been trying to write this formula in matlab, but I have not had many results. The formula is as follows:
in addition, the Ln must have a conditional, where, if Pi is negative or equal to 0, the result of the ln of that Pi is 0.
If someone can help me, it would be very helpful
Thanks

Respuestas (1)

Walter Roberson
Walter Roberson el 6 de En. de 2022
W = log(p);
W(p <= 0) = 0;
N = exp(-sum( p .* W));
  2 comentarios
Santiago
Santiago el 6 de En. de 2022
Hi Walter, thank you for your answer.
But I made some mistakes when i tried to explain my question
Walter Roberson
Walter Roberson el 6 de En. de 2022
Ln = log(p);
Ln(p <= 0) = 0;
N = exp(-sum( p .* Ln));

Iniciar sesión para comentar.

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by