How to find number of elements using a for loop

2 visualizaciones (últimos 30 días)
Johnathan Turner
Johnathan Turner el 18 de Feb. de 2021
Respondida: Matt J el 18 de Feb. de 2021
Hello I have an matrix like this A=[1,2,7,2,2,7; 5,4,9,5,4,2]
Using a for loop I need to find the elements larger than 2

Respuestas (1)

Matt J
Matt J el 18 de Feb. de 2021
for i=1:numel(A), A(i)>2, end

Categorías

Más información sobre Loops and Conditional Statements 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