Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:45:50+00:00 2026-05-26T19:45:50+00:00

I checked the answers about Lagrange interpolation, but I couldn’t find a suitable one

  • 0

I checked the answers about Lagrange interpolation, but I couldn’t find a suitable one to my question. I’m trying to use Lagrange interpolation for a surface with matlab. Let’s say I have a x and y vector and f=f(x,y). I want to interpolate this f function. I think, what I did is mathematically correct:

function q = laginterp(x,y,f,ff)

n = length(x);
m = length(y);
v = zeros(size(ff));
for k = 1:n
    for l = 1:m
        w1 = ones(size(ff));
        w2 = ones(size(ff))
        for j = [1:k-1 k+1:n]
            for j = [1:l-1 l+1:n]
                w1 = (x-x(j))./(x(k)-x(j)).*w1;
                w2 = (y-y(i))./(y(l)-y(i)).*w2;
            end
        end
        ff = ff + w1.*w2.*f(k,l);
    end
end

It is my function and then I’m waiting for an answer for any given x,y,f like

x= 0:4;
y = [-6 -3 -1 6];
f=[2 9 4 25 50];

v = laginterp(x,y,f,ff);
plot3(x,y,'o',f,q,'-')

I’m always grateful for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:45:50+00:00Added an answer on May 26, 2026 at 7:45 pm

    This doesn’t address your question directly, but there’s a Lagrange interpolation function on the Matlab File Exchange which seems pretty popular.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've already checked this.. similar question but I am not convinced about the answers...
I've checked other threads about this subject, but nothing really answers my exact question.
possibly it is silly to ask such questions, but really couldn't find any answers
I checked the documentation and I couldn't find a way o renaming or copying
I recently asked a question about functional programming, and received (good!) answers that prompted
I have read lots of questions and answers about this issue on StackOverflow, but
I have seen some other questions about this, but none of the answers really
I've read the lame documentation, and checked other answers. I'd like my Android app
I checked out the three20 source and was trying to follow this guide to
I checked all the topics, but i simply don't know why my script does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.