help I have 40 iteration , 10 iteration of 40 at random to do something and the other 30 iteration for do another thing??
显示 更早的评论
help I have 40 iteration , 10 iteration of 40 at random to do something and the other 30 iteration for do another thing?? for t=1:40 take 10 of 40 at random to do something and other 30 for do another thing
采纳的回答
更多回答(1 个)
Marcel
2015-1-19
Don't quite understand the question. Can't you just create 2 loops?
For i=1:30
<stuff happens>
end
For i=31:40
<other stuff happens>
end
2 个评论
maha ismail
2015-1-19
Stephen23
2015-1-19
@ Marcel: you should avoid using i or j as the loop variables, as these are the names of the inbuilt imaginary unit .
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!