pass double symbolic expression to paretosearch

4 visualizzazioni (ultimi 30 giorni)
hi at all.
need to pass two symbolic expression that i must try to minimize with pareto search.
with matlabFunction i turn the symbolic expression to matlab numeric function but there is no way to pass this two function to paretosearch.
Can anyone please help me with simple example?
i reproduce it for me .
thank at all

Risposta accettata

Alan Weiss
Alan Weiss il 23 Feb 2022
It depends on how you created your symbolic expressions.
  • If you have two expressions, say obj1 and obj2, then two runs of matlabFunction returns two function handles, say funobj1 and funobj2. You can pass these to paretosearch by using the handle
twoobj = @(x)[funobj1(x),funobj2(x)];
sol = paretosearch(twoobj,2,...))
  • If you have a 2-D row vector output to your objective function named obj, then matlabFunction returns a function handle funobj that is all ready for paretosearch:
sol = paretosearch(funobj,2,...)
If this doesn't work for you, please ask again with more detail, such as exactly which size inputs and outputs your functions expect, how you call matlabFunction, and how you call paretosearch.
Alan Weiss
MATLAB mathematical toolbox documentation
  7 Commenti
Walter Roberson
Walter Roberson il 23 Feb 2022
Modificato: Walter Roberson il 24 Feb 2022
It is not clear what error you are encountering?
[obj1, obj2] for symbolic expressions obj1 and obj2 simply creates a row vector of the two expressions. When you matlabFunction the results, MATLAB would create an anonymous function that built a row vector of results. (In some cases you need a column vector, in which situation use [obj1;obj2]

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Symbolic Math 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