Добавил:
sabzeee
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:lab 4 / test_gridextrap
.m function test_gridextrap(x,y)
p=x(1):0.1:1.5*x(end);
f=griddedInterpolant(x,y,'linear');
f1=f(p);
f=griddedInterpolant(x,y,'pchip');
f2=f(p);
figure;
plot(x,y,'ro')
plot(p,f1,p,f2)
xline(x(1),'--',{'start of table points'})
xline(x(end),'--',{'end of table points'})
grid on
title('Exptrapolation Of the Table data y(x)');
xlabel('x');
ylabel('interp.function and table data');
legend({'y', 'linear','pchip'},'location','best');
end %function
p=x(1):0.1:1.5*x(end);
f=griddedInterpolant(x,y,'linear');
f1=f(p);
f=griddedInterpolant(x,y,'pchip');
f2=f(p);
figure;
plot(x,y,'ro')
plot(p,f1,p,f2)
xline(x(1),'--',{'start of table points'})
xline(x(end),'--',{'end of table points'})
grid on
title('Exptrapolation Of the Table data y(x)');
xlabel('x');
ylabel('interp.function and table data');
legend({'y', 'linear','pchip'},'location','best');
end %function
Соседние файлы в папке lab 4