For Loop Question- Compensation

I have a computational function like
output = function (sed_dep,sed_rho,sed_speed,bottom_rho,bottom_speed)
(1) I initially have these loops:
for sed_dep=9.5:.5:14.5
for sed_rho=1200:50:1500
for sed_speed=1540:5:1570
for bottom_rho=2200:50:2700
for bottom_speed=1750:20:1850
Then I try to extend my search bound to: ( This is my goal)
for sed_dep=9.5:.5:14.5
for sed_rho=1200:50:2000
for sed_speed=1540:5:1570
for bottom_rho=1500:50:2700
for bottom_speed=1750:20:1910
(2) But I made a mistake to do the following shorter loop instead:
for sed_dep=9.5:.5:14.5
for sed_rho=1550:50:2000
for sed_speed=1540:5:1570
for bottom_rho=1500:50:1950
for bottom_speed=1870:20:1910
What I am doing is very computational intense, what are the optimal loops I can add to achieve my goal without repeating the loop I have already done in (2)? Thanks!

1 个评论

Your question is unclear. Do you mean you've already done the loops in your 2nd block of code though you intended to do the loops in the 3rd block of code; and since the function consumes so much time you don't want to repeat the loops you've already done? That seems trivial.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品

版本

R2017b

标签

Community Treasure Hunt

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

Start Hunting!

Translated by