필터 지우기
필터 지우기

inverse loop

조회 수: 258 (최근 30일)
Arundhatee Talukdar
Arundhatee Talukdar 2011년 11월 22일
댓글: Walter Roberson 2022년 9월 14일
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
Amr
Amr 2016년 10월 12일
sure ... use this command for i=180:-1:1 for j=180:-1:1

댓글을 달려면 로그인하십시오.

답변 (4개)

Fangjun Jiang
Fangjun Jiang 2011년 11월 22일
for i=180:-1:1
for j=180:-1:1
  댓글 수: 1
Scott
Scott 2022년 9월 14일
thanks

댓글을 달려면 로그인하십시오.


Jan
Jan 2011년 11월 22일
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 2011년 11월 22일
편집: Walter Roberson 2022년 9월 14일
do loop for i=180:-1:1
will have a decreasing step by 1
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 9월 14일
... but is not valid MATLAB syntax

댓글을 달려면 로그인하십시오.


Thomas
Thomas 2011년 11월 22일
Try,
for i=180:-1:1
for j =180:-1:1
i
j
end
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by