> 数学 >
用matlab
求次数不超过3 的多项式P(x),使其满足条件:
P(0)=0;P'(0)=0;
P(1)=1,P'(1)=2
人气:338 ℃ 时间:2020-10-01 23:05:13
解答
syms a b c d x
>> p=@(x)a*x^3+b*x^2+c*x+d
p =
@(x)a*x^3+b*x^2+c*x+d
>> s1=p(0)
s1 =
d
>> s2=p(1)
s2 =
a + b + c + d
>> dp=diff(p,x)
dp =
3*a*x^2 + 2*b*x + c
>> dp=@(x)3*a*x^2 + 2*b*x + c
dp =
@(x)3*a*x^2+2*b*x+c
>> s3=dp(0)
s3 =
c
>> s4=dp(1)
s4 =
3*a + 2*b + c
c=d=0
[a,b]=solve('a + b =1','3*a + 2*b =2','a','b')
a =
0
b =
1
P(x)=x²
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版