For and if loops
Mostrar comentarios más antiguos
Quite an easy question I am trying to combine data from two rows, row 3 and row 6 when creating my loop.
for v=1:10
if RT(3,6,v)>0.9
v
end
end
Putting a comma shows a error message and if i use a colon it'll show me from row 3 to row 6 which I dont want. So how can I create this loop with two different rows? Thanks!!
Respuesta aceptada
Más respuestas (1)
James Tursa
el 28 de Oct. de 2019
RT([3,6],v) is the syntax to use for the 3rd and 6th rows of the v'th column of RT. But this is of course going to be two elements, so I don't know what you intend the if-test to do with that. Do you want something to happen if both elements are greater than 0.9? If so, then
if( all( RT([3,6],v) > 0.9 ) )
Categorías
Más información sobre Logical 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!