作业帮 > 综合 > 作业

求MATLAB大神指导

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/14 08:52:09
求MATLAB大神指导
>> syms c x; a=int((exp(x)-c*x)^2,x,0,1);
f=diff(a,c)
f =
(2*c)/3 - 2
>> c=solve('(2*c)/3 - 2=0')
c =
3
怎么一步计算出结果?
>> c=solve(diff(int('(exp(x)-c*x)^2','x',0,1),'c'))
c =
3
再问: >> syms x c;solve(diff(int('(exp(x)-c*x)^2','x',0,1),'c')) Error using char/int (line 9)The method char/int will be removed in a futurerelease. Use sym/int instead. For exampleint(sym('x^2')).
再答: ����Ҫ��syms�����ű�����ֱ����Ϳ����ˣ� c=solve(diff(int(sym('(exp(x)-c*x)^2'),'x',0,1),'c'))