For Loop Question- Compensation
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Adam Danz
am 4 Aug. 2018
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.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!