finding the corresponding value in a for loop
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Atheeb Amjard
el 19 de Abr. de 2021
Comentada: Jonas
el 20 de Abr. de 2021
Hi,
I have created a for loop which loops through a number of columns on the image and finds the number of times that 0 (black colour) occurs in that column
for b=1:50
[c]=numel(find(img597(:,b,1)==0))
end
How do I find the corresponding value ( the column) where the maximum number of 0s has occured. The answer has to be 50
3 comentarios
Jonas
el 20 de Abr. de 2021
it's the same procedure but with the first snippet being
nrOfZeros=sum(img597(:,:,1)==0,2);
which gives you a column vector with the number of 0 per row
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!