How to use find function to get log of the values?
Afficher commentaires plus anciens
Hi,
I'm trying to create a new array B where the values are logs of array A (if greater than 1). If the value is smaller or equal to 1 I need to add 39 to these. So far I'm up to here but I don't know how to add that 39
A=[8 14 3;-13 1 42;-39 -8 15];
B=zeros(size(A));
l=find(A>1);
B(1:length(l))=log(A(l));
Thanks in advance
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Multidimensional Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!