I have two questions related to optimization algorithm. Why does a matrix of zeros is initialized? and what is the meaning/purpose of dimension in these functions?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Faiza Gul
il 28 Set 2021
Commentato: Walter Roberson
il 29 Set 2021
For example in this code snippet what does this Dimension means, why do we use it.
function [LB,UB,Dim,F_obj] = Get_F(F)
switch F
case 'F1'
F_obj = @F1;
LB=-100;
UB=100;
Dim=10;
And why these zeros are generated? what is the purpose? Can we initialize ones matrix instead of zeros.
Code snippet.
Dim=10;
Best_P=zeros(1,Din)
0 Commenti
Risposta accettata
Walter Roberson
il 28 Set 2021
Dim is the number of free variables being optimized over.
Dim=10;
Best_P=zeros(1,Dim)
That is pre-allocation. In context it is not necessarily inititialization of a starting point. However possibly if the optimization is not able to run, this is the value that will get returned.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Problem-Based Optimization Setup in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!