带符号变量的最值问题,谢谢!。

syms a b;
E1=a+b;
E2=a-b;
E3=1;
G=min([E3;E1;E2]);%
c=int(int(G,a,0,pi/2),b,0,2*pi);
我的目的是相求一个式子的积分,但式子中包含了一个取最小值的式子G。运行程序后提示Input arguments must be convertible to floating-point numbers.应该如何解决?

 采纳的回答

G=@(a,b)min([a+b;a-b;1]);
integral(@(b)integral(@(a)G(a,b),0,pi/2,'ArrayValued',true),0,2*pi,'ArrayValued',true)
ans =-23.2857

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!