フィルターのクリア

for loop with non-linear input

2 ビュー (過去 30 日間)
darksideofthemoon101
darksideofthemoon101 2011 年 4 月 5 日
Hi,
I have an array 'layer' that I want to randomise and use in a for loop, in the randomised order.
layer=0.05:0.0025:0.15;
rand_layer = randperm(length(layer));
layer=layer(rand_layer);
I can't use 'layer' as the input for the loop, so is there another way of have the input of the loop in the desired order?
Thanks,
Richard

採用された回答

Sean de Wolski
Sean de Wolski 2011 年 4 月 5 日
for ii = 1:length(layer)
do_stuff_with(layer(ii));
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by