Borrar filtros
Borrar filtros

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

6 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

J. Alex Lee
J. Alex Lee el 8 de Ag. de 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.

Más respuestas (0)

Categorías

Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by