I have reduced the number of points by exporting contour lines only. Now I am able to use some surface fitting tools. I still haven't found the best solution for fitting, so ideas are welcome.
Fitting a 3D sine function to topographic data?
5 次查看(过去 30 天)
显示 更早的评论
I have some topographic data that has a general sinusoidal signature. I can import it to MATLAB in the form of points or as a DEM.
I would like to fit a 3D sine function (z=sin(x)+sin(y)) to my data that looks something like this:
I need to figure out a way to fit this type surface to the data, likely with different parameters for each dataset, and calculate an R^2 value. I have many datasets to work through, so I want to develop something that's efficient.
I'm having trouble figuring out how to approach this problem. The point data is very dense (>3 million) and crashes the Curve Fitting gui. I don't know how I would even try to fit a DEM, if it works the same way or not. Any ideas?
3 个评论
Image Analyst
2016-10-11
Just FYI - that's a 2-D function, not a 3D function. You have two dimensions: x and y, and a value at that point. That means it's a 2-D function. You have only 2 independent coordinates, not 3. For example, a gray scale image is a 2D array (function) regardless if you show it as an image or as a 2.5-D rendering on your flat 2-D computer screen with the surf() function. Doesn't matter - it's still a 2D image.
回答(1 个)
Massimo Zanetti
2016-10-7
A simple idea is to downsample your data (also called decimation). Since your data is very regular, you can remove a lot of samples and then use the fitting tool on the reduce data.
For example try:
r=10; %decimation rate
x = decimate(x,r)
y = decimate(y,r)
and then run fitting tool with x,y.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!