pass double symbolic expression to paretosearch

4 views (last 30 days)
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

Accepted Answer

Alan Weiss
Alan Weiss on 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 Comments
Walter Roberson
Walter Roberson on 23 Feb 2022
Edited: Walter Roberson on 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]

Sign in to comment.

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!