如何在符号表达式中使用min()。
이전 댓글 표시
如下代码的目的是想在符号表达式中使用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);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!