Matlab: using linterp to interpolate beach contours

  • MATLAB
  • Thread starter rocks rock
  • Start date
  • Tags
    Matlab
In summary, the conversation is about creating a plot of elevation contours on a beach and using linterp for interpolation. The issue is that linterp is picking up the landward most contour instead of the seaward most. The individual is seeking a workaround or another method of interpolation, such as interp2. It was suggested to use curveintersect and it has proven to be successful.
  • #1
rocks rock
3
0
Hi,

I am trying to create a plot of how certain elevation contours on a beach change over time. I have been using linterp for this so far. I want to interpolate a cross-shore (from dune to shoreline) position for a certain elevation from my data.

The issue I'm having is that when there is more than 1 occurrence of a particular contour on a particular profile linterp is picking up the landward most contour, but I want to know the location of the seaward most contour.

Any thoughts on a work around or another method of interpolation?

It was suggested to me that I try interp2, but I'm having trouble figuring out how to use that.

Thanks
 
Physics news on Phys.org
  • #2
What's the nature of the data you're linterping, does it report the xyz of points along the surface? Do you encode this in a 3d matrix?
 
  • #3
The data is a series of x and z points (y is assumed the same at all locations).

I think the problem was that linterp was sorting the data based on z before interpolating and we wanted to keep them in order by x.

Now using curveintersect, and it works!
 

Related to Matlab: using linterp to interpolate beach contours

1. How do I use the linterp function in Matlab to interpolate beach contours?

The linterp function in Matlab is used to perform linear interpolation between two points. To use it for interpolating beach contours, you will first need to have a set of data points representing the beach contours. Then, use the linterp function to generate a continuous line between these points, creating a smooth curve that represents the beach contours.

2. Can I use linterp to interpolate irregularly spaced beach contour data?

Yes, the linterp function in Matlab can handle irregularly spaced data. It uses a linear interpolation method, which means it will create a straight line between two points and fill in the gaps in between. This can be useful when working with beach contours, as the data may not always be evenly spaced.

3. How accurate is the linterp function for interpolating beach contours?

The accuracy of the linterp function depends on the quality and spacing of the data points used. Generally, it is a good method for creating a smooth curve between two known points, but it may not be as accurate for predicting the exact shape of the beach contours in areas where data points are sparse.

4. Can I use linterp to extrapolate beach contours beyond my data points?

No, the linterp function in Matlab is not designed for extrapolation. It can only interpolate between known data points, so attempting to use it to predict beach contours beyond your data points may result in inaccurate or unreliable results. It is best used for interpolating within the range of your existing data.

5. Are there any alternative methods to linterp for interpolating beach contours in Matlab?

Yes, there are other interpolation methods available in Matlab, such as spline and griddata. These methods may offer different levels of accuracy and can be useful when working with different types of beach contour data. It is recommended to experiment with different methods to determine which one works best for your specific data set.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
700
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
841
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top