How can I skip zero values in an array when evaluating the correlation coefficient ?
Mostrar comentarios más antiguos
Hello, I am kind of new to Matlab and I am running into some issues evaluating the correlation coefficient between the natural logarithm of two arrays(chan1 and chan2) each of size 577*1 that includes zero values that I would like to skip when calculating the correlation coefficient. I thought I could do a nested for loop to skip the zero values and this is what I have:
for chan1 ~= 0
for chan2 ~=0
c = corrcoef(log(chan1),log(chan2))
end
end
But it seems like that Matlab does not like it when one uses does not equal to in a for loop
Please help me solving this issue.
Thanks!
1 comentario
Faisal Alghamdi
el 14 de Jul. de 2017
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!