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
The secant method is an iterative root nding method that is super-linear. The method has the advantage that it is faster than linear methods and does not require knowledge of the

The purpose of this lab is to introduce students to the basic concept of overtones. In order to generate two tones at the same time, you need to generate two waveforms and add them

Write a Matlab function that computes y1= tan(x) and y2= sin(x)/cos(x), returns the difference |y1-y2| and prints a message whether the two are equal or not. Test your function for

i want to save the values of a particular equation in a for loop.. for ex: for i=1:100 et=(x+yz); end thus how can i store the values of et at each iteration

Implement a single-layer perceptron and train it to translate the digital letters given in the file "pattern1" into the corresponding ASCII representation. Plot a training curve an

Customizing a Plot: Line Types, Color, Marker Types: Plots can be completed in the Command Window, if they are really simple. Though, at many times it is desirable to customiz

Adaptive filters can also be used in other applications. Speech recognition, for example, is performed in a non-stationary environment, and therefore may require adaptive filtering

Q. The steady-state circuit i(t) in a series RL circuit due to a periodic sawtooth voltage is given by where θ n = tan -1 (nω 0 L/R).With the parameters V A = 25 V, T 0

write matlab program for Cubic Spline Sweep Surface

This project carries 50% of your ?nal mark. Please hand in your work to the Mathematical and Physical Sciences School O?ce, no later than 4pm Monday 21st January 2013. Please ?l