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

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.应该如何解决?

 Risposta accettata

0 voti

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

Più risposte (0)

Categorie

Tag

Community Treasure Hunt

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

Start Hunting!