About neville's method.
조회 수: 25 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Roger Stafford
2013년 5월 19일
편집: Roger Stafford
2013년 5월 19일
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 http://en.wikipedia.org/wiki/Neville'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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!