채택된 답변

mdpexbn
mdpexbn 2023년 5월 22일

0 개 추천

你这含有未知数x,也不给值,当然没有数值了
clear all
x1 = [0.2 0.4 0.6 0.8 1.0];
y1 = [0.98 0.92 0.81 0.64 0.38];
n = length(y1);
c = y1;
for j = 2 : n
for i = n:-1:j
c(i)=(c(i)-c(i-1))/(x1(i)-x1(i-j+1));
end
end
x = 1;
df(1)=1;
d(1)=y1(1)*df(1);
for i =2:n
df(i) = df(i-1)*(x-x1(i-1));
d(i)=c(i)*(df(i));
end
p4 = vpa(d,5)
plot(x1,double(p4))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 线性代数에 대해 자세히 알아보기

태그

질문:

2023년 5월 22일

답변:

2023년 5월 22일

Community Treasure Hunt

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

Start Hunting!