Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
初级会员
注册日期: 2009-04-27
帖子: 5
声望力: 0 ![]() |
![]()
f={[theta*(1-d)/(theta*d-d)+1]*w-c}*a*{a*(1+b)/[2*h*(theta-1)]}^(b/1-b)*[(theta-1)*d/theta]^[theta /(1-b)]*w^[(1-b)/(b- theta)]
针对上面的函数对d求一阶导数,我是用diff函数来实现。但是matlab的提示为 ??? Error using ==> sym.sym Conversion to 'sym' from 'cell' is not possible. Error in ==> sym.mtimes at 8 A = sym(A); 补充:之前使用syms定义变量。对其他稍简单的函数适过:没有问题的。 有经验的朋友进来解答。 |
![]() |
![]() |
![]() |
#2 |
高级会员
注册日期: 2008-01-02
帖子: 247
声望力: 22 ![]() |
![]()
对函数f的书写不合matlab语法----此处花括弧、方括弧用错。
|
![]() |
![]() |
![]() |
#3 |
高级会员
注册日期: 2008-01-02
帖子: 247
声望力: 22 ![]() |
![]()
>>syms theta a b c d w h;
>>f=( ( theta*(1-d)/(theta*d-d)+1 ) *w-c )*a*( a*(1+b)/ ( 2*h*(theta-1) ) )^(b/1-b)* ( (theta-1)*d/theta ) ^ (theta /(1-b) ) *w^ ( (1-b)/(b- theta) ); >>pretty(f); >>foverd = diff(f,d) >>foverd= (a*w*(theta/(d - d*theta) + (theta*(d - 1)*(theta - 1))/(d - d*theta)^2))/(w^((b - 1)/(b - theta))*((d*(theta - 1))/theta)^(theta/(b - 1))) + (a*(theta - 1)*(c - w*((theta*(d - 1))/(d - d*theta) + 1)))/(w^((b - 1)/(b - theta))*(b - 1)*((d*(theta - 1))/theta)^(theta/(b - 1) + 1)) 注:计算有点儿慢。 |
![]() |
![]() |
![]() |
#4 |
高级会员
注册日期: 2008-01-02
帖子: 247
声望力: 22 ![]() |
![]()
>>pretty(foverd)
/ theta theta (d - 1) (theta - 1) \ a w | ----------- + ------------------------- | | d - d theta 2 | \ (d - d theta) / ----------------------------------------------- + theta b - 1 ----- --------- b - 1 b - theta / d (theta - 1) \ w | ------------- | \ theta / / / theta (d - 1) \ \ a (theta - 1) | c - w | ------------- + 1 | | \ \ d - d theta / / --------------------------------------------- theta b - 1 ----- + 1 --------- b - 1 b - theta / d (theta - 1) \ w (b - 1) | ------------- | \ theta / |
![]() |
![]() |