loop

1 次查看(过去 30 天)
Mate 2u
Mate 2u 2012-6-18
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
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
Walter Roberson 2012-6-18
KVals = 0.4:0.01:0.99;
for K = 1 : length(KVals)
thisval = KVals(K);
...
end

更多回答(1 个)

Thomas
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

类别

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