Reduce Matrix size with interpolated data arrays
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi,
I have a 360*720 precipitation matrix with values in milimeter, and i desire a 180*360 matrix with interpolated data to compare my precipitation with other 180*360 data.
here you can see the original 360*720 plot of my data. please help me on this.
Thank you.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/545037/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/545037/image.jpeg)
댓글 수: 0
채택된 답변
Mathieu NOE
2021년 3월 10일
hello
simply use a 2D interpolation with the appropriate new Xq and Yq vectors
interp2 2-D interpolation (table lookup).
Vq = interp2(X,Y,V,Xq,Yq) interpolates to find Vq, the values of the
underlying 2-D function V at the query points in matrices Xq and Yq.
Matrices X and Y specify the points at which the data V is given.
댓글 수: 2
추가 답변 (1개)
Jan
2021년 3월 11일
The mean over neighboring rows and columns is smarter than a linear interpolation, which just omits the intermediate rows and columns:
x = rand(360, 720);
y = x(1:2:end, :) + x(2:2:end, :);
z = (y(:, 1:2:end) + y(:, 2:2:end)) / 4;
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!