Extrapolating from matrix data

3 次查看(过去 30 天)
Steve
Steve 2019-3-4
I have a matrix that is 152 x 152:
Is there a way to extrapolte this matrix to 500 x 500 without getting the x-y-z data from it first?
Thanks,
Steve
  2 个评论
John D'Errico
John D'Errico 2019-3-4
Yes. But you might be foolish to extrapolate that far out. I'm not saying that people never do foolish things, but why add your name to the list? ;-)
My favorite quote about extrapolation cames from Mark Twain himself, in Life on the Mississippi (1884).
"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."
John D'Errico
John D'Errico 2019-3-5
编辑:John D'Errico 2019-3-5
@Steve: Please don't add an answer just to make a comment. Moved to a comment:
"Thanks for the diatribe.
I understand my application and the pitfalls associated with extrapolation.
Do you have an answer?
Thanks,
Steve"

请先登录,再进行评论。

回答(1 个)

John D'Errico
John D'Errico 2019-3-5
Sigh. Hint:
help interp2
help griddedInterpolant
Note that both allow you to extrapolate. I'm not sure what "getting the xyz data from it" means. You can't use a call to meshgrid to create x and y?
  2 个评论
Steve
Steve 2019-3-5
Thanks John,
I looked at those functions previously and thought that they needed X,Y vectors with z values. For example, I usually use griddata like this:
Shift=griddata(x,y,z,xi,yi,'v4') to extrapolate out to a larger grid than contained in the data and it works great.
The issue that I'm having now is that my surface contains >50,000 XY pairs and griddata with the 'v4' argument fails for running out of memory. I can use 'nearest' but I don't like the solution that it resolves to.
So what I want to do (if it's possible) is to find a function that takes a matrix as an input and expands it out into a meshgrid or other of a larger size than the matrix, with something other than 'linear', and prefereably a nice spline like v4 offers.
Steve
Steven Lord
Steven Lord 2019-3-5
When you say ">50,000 XY pairs", are they on a grid (230-by-230 or thereabouts?) or are they scattered? If they're scattered, take a look at scatteredInterpolant.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by