mirror of
https://bitbucket.org/Mattrixwv/octavefunctions.git
synced 2025-12-06 18:53:57 -05:00
17 lines
351 B
Matlab
17 lines
351 B
Matlab
close all
|
|
clear all
|
|
format long
|
|
|
|
%Set your values
|
|
x_data = [1, 1.3, 1.6, 1.9, 2.2];
|
|
y_data = [0.7651977, 0.6200860, 0.4554022, 0.2818186, 0.1103623];
|
|
x = [1.1, 1.5];
|
|
|
|
%Get the values for x
|
|
values = LagrangeInterpolation(x_data, y_data, x);
|
|
|
|
%Display nicely
|
|
for(k = 1:size(x) + 1)
|
|
disp(['P(' num2str(x(k)) ') = ' num2str(values(k), '%11.7f')])
|
|
end
|