Re: [問題] for loop可以指定變數值嗎?已回收
※ 引述《freezein (....)》之銘言:
: 之前用for loop總是會寫
: for i=1:1:13
: ........
: end
: 請問如果想要設定i=30, 47, 63...
: 請問loop要怎麼寫呢?
: 感激不盡!
如果沒有規律的話
可以先把要用的數字用矩陣存好
像是A = [ 30 47 63 ]
然後要用的時候再用index去叫出來用
像這樣
for i = 1 : 3
A( i )
end
--
A Man or a Parasite
What is the difference between a man and a parasite? A man builds. A parasite
asks "Where is my share?" A man creates. A parasite says, "What will the
neighbors think?" A man invents. A parasite says, "Watch out, or you might
tread on the toes of God..."
─Andrew Ryan
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.225.205.65
推
07/22 23:14, , 1F
07/22 23:14, 1F
推
07/23 00:23, , 2F
07/23 00:23, 2F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章