Index exceeds matrix dimensions error

2 ビュー (過去 30 日間)
David Alagoa
David Alagoa 2017 年 6 月 21 日
回答済み: alice 2017 年 6 月 22 日
I am trying to perform optimisation using genetic algorithm and when I start the solver, I get this error => "Index exceeds matrix dimensions"
This is my code
%photon current estimation
function result = PhotonFcn(x)
Iph = x;
Isc = 5.98;
Ki = 0.0035;
Top = 273 + 46;
Trf = 273 + 25;
result = (Isc + Ki(Top - Trf)) - Iph;
end
Please help!
  2 件のコメント
alice
alice 2017 年 6 月 21 日
Typo, you forgot the *:
result = (Isc + Ki *(Top - Trf)) - Iph;
Jan
Jan 2017 年 6 月 21 日
@alice: Please post this in the field for answers, such that it can be accepted as solution. Thanks.

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

回答 (1 件)

alice
alice 2017 年 6 月 22 日
You made a typo, you forgot the *:
result = (Isc + Ki *(Top - Trf)) - Iph;

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by