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
Problem 1:   What are the different methods that can be used to solve a differential equation? Please provide a numbered list. Problem 2:   For a first order linear d

Obtaining the Partial Fraction Expansion of the Z-Transform expression and to find its Inverse Z-Transforms using MATLAB

how to make a histogram of data, example x=[5 6 3 2 5] and then find the distribution

Hi I''m wondering if someone can help me with Matlab coursework

Illustration of Output statements: For illustration, >> disp('Hello') Hello >> disp(4^3)   64 The formatted output can be printed to the screen by using the fpr

Passing Multiple Arguments: In many situaion it is essential to pass more than one argument to the function. For illustration, the volume of a cone is given by here r

Write a matlab function that calls eig and generates an estimate of the smallest three eigenvalues and associated eigenfunctions of the negative Laplacian operator on ?. (Hint: thi

Savannah says that the least common multiple of 4 and 6 is 24. Is she right or what is her mistake?

Code and decode a 32 bit long data for a specific user in CDMA if there is only 1 user and no noise.

how do I make a second main function?