Multiple Variable For Loop
古いコメントを表示
Hi
I have so far written this for loop
for i = 1:VgStep
for start = 1:VgStep:endPoint-VgStep+1
for step = VgStep:VgStep:endPoint
Vd{j}{i} = x(start:step);
Id{j}{i} = y(start:step);
end
end
end
I appologise for not explaining what all the terms are, but what I need is combine all those for's into one, because I end up just getting the same value for all my Vd{j}{i} terms
I'll explain better if it is needed
4 件のコメント
Adam Parry
2012 年 7 月 31 日
John Petersen
2012 年 7 月 31 日
編集済み: John Petersen
2012 年 7 月 31 日
Can you give an example of what you want? All we have to go on is your code, which doesn't do what you want so we have to just guess. also, start and step are reserved words.
Adam Parry
2012 年 7 月 31 日
編集済み: Adam Parry
2012 年 7 月 31 日
Walter Roberson
2012 年 7 月 31 日
John, neither start nor step are reserved words. See http://www.mathworks.com/help/techdoc/ref/iskeyword.html
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!