Find the right hand side of the interpolation system, MATLAB Programming

function y=tps(r)

% This is the thin-plate spline

if r < 0.000000000001

 y=0;

else

 y=r^2*log(r);

end

function y=fun(point)

% my target function

x=point(1);

z=point(2);

y=7-4*x^2+z^3;

function y=interpmat(points)

% this file computes the interpolation matrix

[n,m]=size(points);

for i=1:n

ipoint=points(i,:);

for j=1:n

jpoint=points(j,:);

mat(i,j)=tps(norm(ipoint-jpoint));

end

mat(i,n+1)=1;

mat(n+1,i)=1;

mat(i,n+2)=ipoint(1);

mat(n+2,i)=ipoint(1);

mat(i,n+3)=ipoint(2);

mat(n+3,i)=ipoint(2);

end

y=mat;

function y=righthandside(points)

% find the right hand side of the interpolation system

[n,m]=size(points);

for i=1:n

y(i)=fun(points(i,:));

end

y(n+1)=0;

y(n+2)=0;

y(n+3)=0;

function y=testinterp(n,m)

% this file test our interpolation routine

points=rand(n,2);

% compute interpolation matrix

mat=interpmat(points);

% create the right hand side

rhs=righthandside(points);

solution=inv(mat)*rhs';

% test solution

tpoints=rand(m,2)

maxerr=testsol(points,tpoints,solution);

Posted Date: 3/7/2013 4:22:32 AM | Location : United States







Related Discussions:- Find the right hand side of the interpolation system, Assignment Help, Ask Question on Find the right hand side of the interpolation system, Get Answer, Expert's Help, Find the right hand side of the interpolation system Discussions

Write discussion on Find the right hand side of the interpolation system
Your posts are moderated
Related Questions
Define a function: The radius of a circle is passed to the function to input argument  rad; the function computes the area of this circle and stores it in the output argument

Micro-mouse is an engineering design competition created by IEEE in the late 1970s. Small robotic "mice" solve a 16x16 cell maze. The mice are completely autonomous and must find t

Example of Referring elements: the vector can also be extended. For illustration, the following generates a vector which has three elements. And then referring to the fourth e


Non-Ideal Gas (van der Waals equation):  An equation of state for a non-ideal which is commonly used is the van der Waals equation for 1 mol of gas  P = (R*T)/(V-b) - a/(V^2)

what equation equals 36

Implement a MatLab function to calculate y.  The function should take two input arguments 1) A vector of parameters In the above example this would be of length 3, the first

using newton divided diference formula find f(15) and f (8)

how to reverse the digits of positive number by using mod function?

Various commands for get the help: There are various commands which can serve as an introduction to MATLAB and allow you to get the help: info will show contact informatio