For Loop Question- Compensation

5 ビュー (過去 30 日間)
Tsuwei Tan
Tsuwei Tan 2018 年 8 月 4 日
コメント済み: Adam Danz 2018 年 8 月 4 日
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 件のコメント
Adam Danz
Adam Danz 2018 年 8 月 4 日
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 件)

カテゴリ

Help Center および File ExchangeLoops 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