Undefined function 'min' for input arguments of type 'sym'.
Ältere Kommentare anzeigen
I'm attempting to run this code:
syms x1 x2 n;
assume(n>=0);
f = 2*x1^2 + 2*x2^2 - 2*x1*x2 + 2*x2^4 - 8*x1 + 5;
x = [200;-200];
m = solve (subs(f,[x1,x2],x + gam^n * d) <= subs(f,[x1,x2],x) + c*gam^n * gradx.'*d,n,'Real',true);
This returns the output
m =
Dom::Interval([0], [log(((184569509574205728450482700682269373180522852473434683651^(1/2)*486498208513403250724216051735683681829508695373292628743349050048000000000000000000000000^(1/2))/486498208513403250724216051735683681829508695373292628743349050048000000000000000000000000 - 174085952029516886891/9060546018411093202398740995200000000)^(1/3) - 5120384012576201153/(2359472952176702208291600000000*((184569509574205728450482700682269373180522852473434683651^(1/2)*486498208513403250724216051735683681829508695373292628743349050048000000000000000000000000^(1/2))/486498208513403250724216051735683681829508695373292628743349050048000000000000000000000000 - 174085952029516886891/9060546018411093202398740995200000000)^(1/3)) + 2/480009)/log(7/10)])
So far, so good. But then I try and take the minimum of the interval:
min(m)
And I get:
Undefined function 'min' for input arguments of type 'sym'.
What's going on, and how do I fix it?
Antworten (1)
Walter Roberson
am 16 Apr. 2013
0 Stimmen
Try double(m) and see what that returns. If that fails, vpa(m) should at least convert the log etc. into decimal.
As it is a non-empty interval, the min() of it will be the first operand of Interval(), namely the 0.
Kategorien
Mehr zu Common Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!