Matlab: using linterp to interpolate beach contours

  • Context: MATLAB 
  • Thread starter Thread starter rocks rock
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

This discussion focuses on using Matlab's linterp function for interpolating beach contours, specifically addressing the challenge of identifying the seaward most contour when multiple occurrences exist. The user initially faced issues with linterp prioritizing the landward contour due to its sorting mechanism. A successful workaround was implemented using the curveintersect function, which resolved the interpolation issue effectively.

PREREQUISITES
  • Familiarity with Matlab programming
  • Understanding of interpolation techniques in data analysis
  • Knowledge of contour plotting and elevation data
  • Experience with 3D data representation in Matlab
NEXT STEPS
  • Learn how to use Matlab's interp2 function for 2D interpolation
  • Explore the curveintersect function for resolving contour intersection issues
  • Research best practices for handling multiple contour occurrences in elevation data
  • Investigate advanced Matlab plotting techniques for visualizing elevation changes over time
USEFUL FOR

Researchers, environmental scientists, and engineers working on coastal geomorphology or anyone involved in analyzing and visualizing elevation data using Matlab.

rocks rock
Messages
3
Reaction score
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
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?
 
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!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
9K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
3
Views
7K