Borrar filtros
Borrar filtros

How to work with arrays with values of Log(0)?

13 visualizaciones (últimos 30 días)
Jacinto Elias Sedeño-Díaz
Jacinto Elias Sedeño-Díaz el 8 de Dic. de 2020
Respondida: David Hill el 8 de Dic. de 2020
I am working with arrays that include zero values. One transformation I must do is apply logarithms to each value in the matrix. In the result, I need to do other operations but I have to skip the values that do not have a result of the logarithm. How can I do that?
Thanks

Respuestas (1)

David Hill
David Hill el 8 de Dic. de 2020
a=log(initialArray);
idx=initialArray~=0;
a(idx)=5*a(idx);%other calculations only perform on non-zero values of initial array

Categorías

Más información sobre Exponents and Logarithms en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by