Speed up fminbnd using vectorization
古いコメントを表示
I am trying to optimize this piece of code. I am using the function fminbnd on a vector, splitting the task on its single entries using a loop.
Would it be possible to speed it up vectorizing the process?
for i = 1:A
for ii= 1:B
for iii = 1:C
fun = @(x) (x * variable(i,ii,iii))^2 ;
[arg_min(i,ii,iii), min_(i,ii,iii)] = fminbnd(fun,0,2);
end
end
end
Thanks for the attention.
Sincerely
Luca
採用された回答
その他の回答 (2 件)
Luca Gagliardone
2017 年 8 月 16 日
編集済み: Luca Gagliardone
2017 年 8 月 16 日
Nick Durkee
2018 年 5 月 24 日
編集済み: Matt J
2018 年 5 月 24 日
0 投票
I actually developed a solution to this problem for my research. It's available on the file exchange.
カテゴリ
ヘルプ センター および File Exchange で Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!