MATLAB: Way to extend and interpolate the matrix by using thin plate spline

thin plate splinetps

if I do have surface matrix 30*30 Is there any possible way to interpolate surface matrix and extend it as 60*60 by using thin plate spline method?
I tried to use function 'fit' for TPS but I don't know how to make it.
IDL has function called 'MIN_CURVE_SURF' http://www.harrisgeospatial.com/docs/MIN_CURVE_SURF.html
I am pretty sure MATLAB can do it as IDL.

Best Answer

It is not clear in my opinion what you are asking.
If your question is how should one simply resample the domain by interpolation, so the new array will be more finely sampled over the same domain, then just use interp2. You have a choice of methods there.
If your question is how does one explicitly extrapolate a matrix out a significant distance, and you want to use a thin plate spline?
Mark Twain answered that question better than anyone else I know of:
“In the space of one hundred and seventy six years the Lower Mississippi has shortened itself two hundred and forty-two miles. That is an average of a trifle over a mile and a third per year. Therefore, any calm person, who is not blind or idiotic, can see that in the Old Oölitic Silurian Period, just a million years ago next November, the Lower Mississippi was upwards of one million three hundred thousand miles long, and stuck out over the Gulf of Mexico like a fishing-pole. And by the same token any person can see that seven hundred and forty-two years from now the Lower Mississippi will be only a mile and three-quarters long, and Cairo [Illinois] and New Orleans will have joined their streets together and be plodding comfortably along under a single mayor and a mutual board of aldermen. There is something fascinating about science. One gets such wholesale returns of conjecture out of such a trifling investment of fact.”
Life on the Mississippi (1884)
Using a spline in any form to do significant extrapolation is asking for trouble and silly results, much like the quote above. The fact is, one of the most common interpolation problems I see is when people try to use an interpolant to extrapolate. Expect random crap as a result, or at least don't be surprised at that event.
You might decide to try my gridfit or inpaint_nans tools, both found on the file exchange. Either could be used here. In the default mode, both will aim to extrapolate as linearly as possible, so they are not too poorly behaved. Both tools also have an option that attempts to extrapolate as a constant, to the extent that is possible.
Related Question