Interpolation of 3d matrices for contourf plot
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
This 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.
![Datapoint.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209036/Datapoint.jpeg)
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.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!