Mo logo [home] [lexicon] [problems] [tests] [courses] [auxiliaries] [notes] [staff] german flag

Mathematics-Online problems:

Interactive Problem 14: Matlab-Program: Rational Interplation


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Find a MATLAB-program $ [A,B] =$   ratip$ (X,F)$, to determine the coefficients $ a_i,b_i$ of the rational interpolation problem

$\displaystyle \frac{p(x_i)}{q(x_i)}=f_i\,,
$

$\displaystyle p(x) = a_1+a_2x+\cdots+a_nx^{n-1}+a_{n+1}x^n\,,\quad
q(x) = 1+b_1x+\cdots+b_nx^n
$

by solving the LSE

$\displaystyle \sum_{j=1}^{n+1} a_jx_i^{j-1} = (1+\sum_{k=1}^n b_kx_i^k)f_i\,,\quad i=1:2n+1\, .
$

Use the MATLAB-command \ in such a way, that in the case of a singulary system the approximative solution is calculated.

Hint: Declare $ A,B,X,F$ as column vectors.


Solution:

Program output calling

>> x=pi*[0:.5:2]
>> f=cos(x)
>> [A,B]=ratip(x',f')
rounded off to four decimal places:
A=[ ; ; ],          B=[ ; ] .

   
(Authors: Höllig/Höfert)

[Links]

  automatically generated: 8/11/2017