Index exceeds matrix dimensions error
Show older comments
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!
Answers (1)
alice
on 22 Jun 2017
You made a typo, you forgot the *:
result = (Isc + Ki *(Top - Trf)) - Iph;
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!