Optimization of a matrix variable
Afficher commentaires plus anciens
Hello all,
I am writting a code for optimization where I have a optimizing variable as a matrix of N*L.How I can declare this matrix variables within a function as an objective function?
I am trying like that,
N=2;
L=10;
z = rand(N,L);
r= mainfcn(z,N)
function r= mainfcn(z,N)
a=z(N:L);
r = a.^2- 1;
end
here I am getting 'a'= as a vector not a matrix. How I can make 'a' as a matrix of N*L?
Thanks in advance.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Direct Search dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!