Azzera filtri
Azzera filtri

how to perform a multi variable optimization on matlab

5 visualizzazioni (ultimi 30 giorni)
i have a two variable cost function to minimize,is there specefic type of optimization to do it , i am trying some metaheuristics and when introducing the second variable it shows "not enough input variables" any recommendations please ? thank you
  4 Commenti
Anwar
Anwar il 19 Feb 2024
for the algorithm used ive tried many metaheuristics and only worked with one variable ,is there a way to make any algorithm work with two variables or there are specefic algorithms for the task
Walter Roberson
Walter Roberson il 19 Feb 2024
%example
nvars = 23;
fun = @(xSv) costfunction(xSv(1:10), xSv(11:nvars));
[bestxSv, fval] = ga(fun, nvars);

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 19 Feb 2024
There are several different minimizers possible. Everything except fzero() -- fzero() is restricted to one variable.
fun = @(XYZ) YourFunction(XYZ(1), XYZ(2), XYZ(3))

Categorie

Scopri di più su Problem-Based Optimization Setup in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by