Borrar filtros
Borrar filtros

Interpolation of 3d matrices for contourf plot

1 visualización (últimos 30 días)
Benjamin Karlsen
Benjamin Karlsen el 18 de Mzo. de 2019
Hi
I have a set of measurements done in a 2D plane where i have used different spatial resolution for my measuremen points in the X- direction. Datapoint.jpgThis is a picture of each measurement point witha higher resolution in the center than at the ends. The circle is showing an object around which I am measuring, but that is not important.
I want to do contour plots of this plane where each point has several different calculated values. Right now all the data is stored in a 41x25x21 matrix, however the lines where the resolution differs from the center has just NaNs at the end. 41 is the highest resolution in X direction, the 25 columns contain all the data in each point, like x and y position in cartesian coordinates, or measured pressure / velocity. 21 accounts for the number of different horizontal lines at the different Y position.
To do a contourf plot I need each line to have the same resolution in the x direction, so I need some sort of interpolation. I only want the values to be interpolated with the nearest neighbours in the x direction but to be of the same resolution as the once in the center. I have tried using the functions line interp2, 3, 1 but I am not getting it to work.
Anyone have any idea? Do I perhaps need to separate the lines with different resolution into new matrixes?
RIght now the 3d matrix is called line. X position is line(:,2,:) (column to for each line) and y position is line(:,3,) (column 3 for each line). The other columns measured and calculated values.

Respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by