如何在符号表达式中使用min()。
Ältere Kommentare anzeigen
如下代码的目的是想在符号表达式中使用min()函数,而后转为匿名函数;
代码的意义在于 方便将比较最小这种形式代入到其他式子中,在最终形成的更复杂式子中再将参数代入值。
不成功的代码如下:
clear;clc;
syms a b
A=[a^2,a*b^2,a^2+b^2-2*b];
% Not Work
Ay=min(A);
Af=matlabFunction(Ay)
Af(1,2)
%Bf=Af^2+Cf...;
%Bf(1,2)
错误使用 sym/min (line 123)
Input arguments must be convertible to floating-point
numbers.
出错 Untitled4 (line 5)
Ay=min(A);
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Numbers and Precision 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!