MATLAB Answers

Create loop with variable pitch

조회 수: 1(최근 30일)
Alejandro Fernández
Alejandro Fernández 2019년 12월 4일
댓글: JESUS DAVID ARIZA ROYETH 2019년 12월 4일
Hello very good, I wondered if anyone would know how to create a for loop with variable pitch, the idea is as follows:
I would have to go through the positions 1 3 5 5.5 6 6.5 7 9. what I know is to use two bubles
for i=1:2:9
...
end
for i=5.1:0.5:6.9
...
end
Would there be any way to do it in one loop? Thank you very much.

답변(1개)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 12월 4일
편집: JESUS DAVID ARIZA ROYETH 2019년 12월 4일
for i=[1 3 5 5.5 6 6.5 7 9]
...
end
  댓글 수: 2
JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 12월 4일
What is the pattern that your data follows because if they do not follow a regular pattern you must place them manually, if they have a regular pattern then what would it be?

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by