Borrar filtros
Borrar filtros

inverse loop

258 visualizaciones (últimos 30 días)
Arundhatee Talukdar
Arundhatee Talukdar el 22 de Nov. de 2011
Comentada: Walter Roberson el 14 de Sept. de 2022
I want to use loop from i=180:1 and again next inserted loop j=180:1 Does matlab allow that? how I access (180,180) first rather then (0,0)...
  1 comentario
Amr
Amr el 12 de Oct. de 2016
sure ... use this command for i=180:-1:1 for j=180:-1:1

Iniciar sesión para comentar.

Respuestas (4)

Fangjun Jiang
Fangjun Jiang el 22 de Nov. de 2011
for i=180:-1:1
for j=180:-1:1
  1 comentario
Scott
Scott el 14 de Sept. de 2022
thanks

Iniciar sesión para comentar.


Jan
Jan el 22 de Nov. de 2011
Whenever you have a problem with a specific command, be sure to read the help and doc text for this command:
help for
Step S with increments of -0.1
for S = 1.0: -0.1: 0.0, do_some_task(S), end

karan
karan el 22 de Nov. de 2011
Editada: Walter Roberson el 14 de Sept. de 2022
do loop for i=180:-1:1
will have a decreasing step by 1
  1 comentario
Walter Roberson
Walter Roberson el 14 de Sept. de 2022
... but is not valid MATLAB syntax

Iniciar sesión para comentar.


Thomas
Thomas el 22 de Nov. de 2011
Try,
for i=180:-1:1
for j =180:-1:1
i
j
end
end

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by