Why does my function abc give error with optimtool
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sadiq Akbar
am 12 Jul. 2022
Bearbeitet: Sadiq Akbar
am 14 Jul. 2022
I have a function file abc. I want to run it with optimtool ga. I do settings in the Optimtool as below:
Solver: ga-Genetic Algorithm
Fitness function: @abc
Number of variable 6
Bounds Lower: [0 0 0 0 0 0] Upper:[180 180 180 180 180 180]
-----------------------------
After running it, it gives the following error:
Optimization running.
Error running optimization.
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
0 Kommentare
Akzeptierte Antwort
Torsten
am 12 Jul. 2022
The product r*k in the line
A = exp(-1j*r*k);% Steering matrix
is not defined.
k is (3x3), r is (Nx3) where N = 10.
Setting N = 3 would make the product to be defined.
6 Kommentare
Torsten
am 14 Jul. 2022
I have no experience with ga.
If your problem is such that you can use "fmincon" or some other deterministic optimizer instead of ga, you should do so.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Problem-Based Optimization Setup finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!