If you’re trying to compile code with YALMIP inside, it will require some work
https://yalmip.github.io/faq/compilesolver/
And as it says in the Simulink example, the YALMIP call has to be done in an interpreted function if you are using Simulink
https://yalmip.github.io/example/simulink/
function out = myfunction1(u)
x = sdpvar(1);
out = optproblem(30>=x>=160,u);
out=maximize(out)
but i doesnt work
function out = myfunction1(tin,e)
yalmip('clear')
T = sdpvar(1);
a=.0017;
b=1.49005*1000-1.4900*1000*tin*tin+2*.0017*1000*tin;
c=(-.0017*1000*tin*tin)-e
Objective=a*T^2+b*T+c;
Constraints = [T-tin <=20, 20 <= T <= 170];
P = optproblem(Constraints,Objective);
out=maximize(P)
but it doesnt work "Evaluation of expression resulted in an invalid output. Only finite double vector or matrix outputs are supported"
diagnostics=maximize(P);
out = value(T)
diagnostics=maximize(P);
out = value(P)