Size problems with interp2
이전 댓글 표시
Hello,
I am working with data that I retrieved from remote sensing and would like to increase the spatial resolution of my data (to work alongside other data of different resolution).
My data matrix is a 2D matrix, where each x and y location yields a data value.
For example, I would like to increase the resolution of my matrix from 38x90 to 500x1000.
Here is what I tried:
----------------------------------------
[a b] = size(SST); %where SST is my 2D matrix containing data values...so then a would be 38 and b would be 90
x = 1:a; %This would serve as the x vector for SST data, x would be 1:38
y = 1:b; %This would serve as the y vector for SST data, y would be 1:90
XI = linspace(1,38,500); %This is the x resolution that I want YI = linspace(1,90,1000); %This is the y resolution that I want
[x y] = meshgrid(x,y); %create vector arrays [XI YI] = meshgrid(XI,YI); %create vector arrays
SST_hiRes = interp2(x,y,SST,XI,YI);
-------------------------------------------------
So basically I receive the following error:
"??? Error using ==> interp2 at 145 Matrices X and Y must be the same size as Z."
I am confused because I retrieved the size of these vectors from the "Z" vector directly.....any thoughts? I don't have the image toolbox unfortunately or I would use imresize.
Thanks for any input!
---Jimmy
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!