필터 지우기
필터 지우기

Index exceeds matrix dimensions error

조회 수: 3 (최근 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 CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by