pass double symbolic expression to paretosearch

4 visualizaciones (últimos 30 días)
Davide Di Luzio
Davide Di Luzio el 21 de Feb. de 2022
Editada: Walter Roberson el 24 de Feb. de 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

Respuesta aceptada

Alan Weiss
Alan Weiss el 23 de Feb. de 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 comentarios
Walter Roberson
Walter Roberson el 23 de Feb. de 2022
Editada: Walter Roberson el 24 de Feb. de 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]
Davide Di Luzio
Davide Di Luzio el 23 de Feb. de 2022
thx at all

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math 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