For Loop Question- Compensation

1 visualización (últimos 30 días)
Tsuwei Tan
Tsuwei Tan el 4 de Ag. de 2018
Comentada: Adam Danz el 4 de Ag. de 2018
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 comentario
Adam Danz
Adam Danz el 4 de Ag. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by