Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

About neville's method.

Asked by zen dyka

zen dyka (view profile)

on 19 May 2013

please help me to solve this problem because I do not understand about the neville's method.

write a computer program for interpolation by neville's method. the program must be able to compute the interpolant at several user-specified values of x. Test the program by determining y at x=1.1, 1.2, 1.3 from the following data:

x       -2.0          -0.1        -1.5            0.5          -0.6          2.2            1.0          1.8

y    2.2796    1.0025    1.6467    1.0635    1.0920    2.6291    1.2661    1.9896


zen dyka

zen dyka (view profile)


No products are associated with this question.

1 Answer

Answer by Roger Stafford

Roger Stafford (view profile)

on 19 May 2013
Edited by Roger Stafford

Roger Stafford (view profile)

on 19 May 2013

My advice would be to first take an example with, say, just three values of x and of y. Forget about computers for a minute and carry out the procedures of Neville's algorithm by hand (or hand calculator) as explained in an article like's_algorithm. You can't do the programming until you fully understand the algorithm.

The next stage is to realize that you have a process with an outer loop and an inner one. At each step of the outer loop the inner loop has one less step to take, until at the final outer loop step there is only one inner loop step remaining, and that one yields the answer. If you are using matlab that should of course suggest two nested for-loops. By carefully translating what you did earlier by hand over to computer action you can write these two loops.

Note that you are under no obligation to use the same notation given in the Wikipedia article. In fact that is highly inadvisable. In particular recall that matlab indices cannot be zero but must start with one.

As a final stage to impress your teacher you can show how that inner loop can rather easily be vectorized.


Roger Stafford

Roger Stafford (view profile)

Contact us