如何在符号表达式中使用min()。
Show older comments
如下代码的目的是想在符号表达式中使用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);
Accepted Answer
More Answers (0)
Categories
Find more on Numbers and Precision 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!