inverse loop

483 Ansichten (letzte 30 Tage)
Arundhatee Talukdar
Arundhatee Talukdar am 22 Nov. 2011
Kommentiert: Walter Roberson am 14 Sep. 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 Kommentar
Amr
Amr am 12 Okt. 2016
sure ... use this command for i=180:-1:1 for j=180:-1:1

Melden Sie sich an, um zu kommentieren.

Antworten (4)

Fangjun Jiang
Fangjun Jiang am 22 Nov. 2011
for i=180:-1:1
for j=180:-1:1
  1 Kommentar
Scott
Scott am 14 Sep. 2022
thanks

Melden Sie sich an, um zu kommentieren.


Jan
Jan am 22 Nov. 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 am 22 Nov. 2011
Bearbeitet: Walter Roberson am 14 Sep. 2022
do loop for i=180:-1:1
will have a decreasing step by 1
  1 Kommentar
Walter Roberson
Walter Roberson am 14 Sep. 2022
... but is not valid MATLAB syntax

Melden Sie sich an, um zu kommentieren.


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

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by