Azzera filtri
Azzera filtri

Optimization variable which takes input in the form of matrix or vectors

6 visualizzazioni (ultimi 30 giorni)
I need to multiply a 100×48 matrix with a 48×1 vector and the sum of the elements of the resultant vector is the objective function. Is it possible that i can model the optimization variables as the columns of the 100×48 matrix?. If so how to write the bounds and objective function. I am using ga solver.

Risposta accettata

J. Alex Lee
J. Alex Lee il 8 Ago 2018
That doesn't seem like a mathematically well-posed optimization problem...but in general Matlab's fminX routines are multidimensional. Maybe you can just reshape to achieve your goal?
x0 = rand(100,48) % initial guess of unknowns to solve for
y = rand(48,1) % your parameters governing the optimization
x = fminX(@(x)objFn(x,y),x0(:)) %
function r = objFn(x,y)
x = reshape(x,100,48); % or compute the correct dimensions based on numel(x) and length(y)
r = sum(x*y); % or do you want sum(abs(x*y))?
end
you would similarly reshape your bounds into vectors.
Or, a quick search reveals that Matlab's fminX functions actually do accept matrix arguments: https://www.mathworks.com/help/optim/ug/matrix-arguments.html.

Più risposte (0)

Categorie

Scopri di più su Get Started with Optimization Toolbox 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!

Translated by