Matlab Function for Lagrange Interpolation

3 ビュー (過去 30 日間)
Muhammed Ahkbar
Muhammed Ahkbar 2017 年 5 月 4 日
コメント済み: KSSV 2017 年 5 月 4 日
My Code is missing two values and I need help:
function y = lagrange (X, Y, x)
n = length(X);
if n ~= length (Y)
error ('X and Y must have the same length.');
end
y = zeros(size(x));
for i = 1:n
L = ones(size(x));
for j = [1:i-1 i+1:n]
L = %complete missing line
end
y = %complete missing line
end
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by