loop
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi I need to do two loops, where the inputs of both need to be 0.4:0.01:0.99, any help on how to achieve this buy by still going through the conventionally i=1: etc (as need this for output).
댓글 수: 1
Kevin Holst
2012년 6월 18일
could you try to describe this a little better, maybe with some of your own code in it. I'm assuming that:
for i = 0.4:0.01:0.99
end
...will not work for you.
채택된 답변
Walter Roberson
2012년 6월 18일
KVals = 0.4:0.01:0.99;
for K = 1 : length(KVals)
thisval = KVals(K);
...
end
댓글 수: 0
추가 답변 (1개)
Thomas
2012년 6월 18일
You could try something like
ii=0.4:0.01:0.99;
for count1 =1:length(ii)
for count2=1:length(ii)
output(count1,count2)= something
ii(count1) and ii(count 2) % these are the variable that you can use and the values in ii
end
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 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!