Filter löschen
Filter löschen

pass double symbolic expression to paretosearch

2 Ansichten (letzte 30 Tage)
Davide Di Luzio
Davide Di Luzio am 21 Feb. 2022
Bearbeitet: Walter Roberson am 24 Feb. 2022
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

Akzeptierte Antwort

Alan Weiss
Alan Weiss am 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 Kommentare
Walter Roberson
Walter Roberson am 23 Feb. 2022
Bearbeitet: Walter Roberson am 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]

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by