Resize a set of 3D Traces

4 views (last 30 days)
Julia
Julia on 12 Aug 2014
Answered: Star Strider on 12 Aug 2014
Hi everyone,
I have the following problem, and I am struggling to find an easy solution.
I have a set of N "traces" in 3D, each represented by a certain number of points P (but each trace has a different number of points, so P is different for each trace).
Here's an example for N=3:
In the above example, the trace on the left is made by 48 points (P=48), the trace in the middle by 50 points (P=50) and the trace on the right by 55 points (P=55).
What I would like to do is "resample" all the traces so they all have the same amount of points (actually I would like each trace to have 48 points, corresponding to the size of the smallest trace). Also, I would like these points to be equidistant between the "edges" of the lines. So I want to keep the edges of the lines, and resample "in between"." The good news is that the 3xP matrices of each trace are organized in a way such that the first and last coordinates correspond to the "edges of the lines".
How could I do that? I tried resampling, but this messes up with the shape of the traces.
Thank you in advance for your help!

Answers (1)

Star Strider
Star Strider on 12 Aug 2014
I don’t know what you mean by ‘resample’. The resample function isn’t intended for what you want to do, but interp2 is. The default interpolation method for the interpolation funcitons is 'linear' but there are other ‘method’ options that might provide a more accurate interpolation. Without seeing your data and knowing in more detail what you want to do, I can’t be more specific than that.

Community Treasure Hunt

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

Start Hunting!