vendredi 19 septembre 2014

Matlab interp1 plot appears offset from data


Vote count:

0




Essentially, I am trying to smooth a contour line from an image segmentation using Matlab's interp1 method. Unfortunately, interp1 is not behaving as I expect, perhaps because I am using it incorrectly. My code for the interpolation follows:



y2 = interp1(x, y, 'nearest');


Then, I attempted to plot the original x value against y2 along with the original function (see attached plot).



plot(Vertices(:,2), y2, 'x');


I thought that the interpolation would smooth the original function - which, to some extent, it does - yet, the interp1 method appears to be offset from the origin and rotated. I would like this result more aligned with the original data. Any guidance would be appreciated.


figure



asked 1 min ago

m.n

13






Matlab interp1 plot appears offset from data

Aucun commentaire:

Enregistrer un commentaire