warning while running optimization tool

Index in position 1 exceeds array bounds (must not exceed 40)
What does this mean?photo is attached below
please help

 採用された回答

Walter Roberson
Walter Roberson 2020 年 1 月 25 日

0 投票

We can predict that your objfun has a place where you use Variable(Parameter) where you should have Variable.*(Parameter)
That is, you try to use implicit multiplication, but MATLAB does not have implicit multiplication, and the operation you are accidentally invoking is indexing instead of multiplication.
In MATLAB A(B) is always either indexing variable A at offset B, or else calling the function indicated by A passing in parameter B. A(B) in MATLAB never means to multiply A and B.

1 件のコメント

DEV
DEV 2020 年 1 月 27 日
ok got it
thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

リリース

R2019a

タグ

質問済み:

DEV
2020 年 1 月 25 日

コメント済み:

DEV
2020 年 1 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by