## interpolate a 2D matrix with nonmatching dimnsions

### interpolate a 2D matrix with nonmatching dimnsions

I have a latitude x longitude matrix with data points at 0 ,1, 2, 3, 4....etc along Y direction(ie latitude ) and 0,1.25,2.5,3.75.....along X direction (longitude) and i need a matrix with data at points 0, 2.5, 5...etc both in X and Y direction.
when tried interp2 with X=0:1:40
and Y=0:1.25:44.25
and Z=data i have(41x35 matrix)
it came that X and Y must have same size as Z
Anila

### interpolate a 2D matrix with nonmatching dimnsions

==============

I'll ask the obvious question. Why do you have X and Y which do not agree in size with Z?

### interpolate a 2D matrix with nonmatching dimnsions

well... what a surprise...
show CSSM the syntax of your call to INTERP2...

us

### interpolate a 2D matrix with nonmatching dimnsions

This is the syntax
a=meshgrid(0:40);
b=meshgrid(58.75:1.25:101.25);
ai=0:2.5:40;
bi=60:2.5:100;
ci=interp2(a,b,c,ai,bi);
Thanks
Anila

### interpolate a 2D matrix with nonmatching dimnsions

because the matrix has 41 rows and 35 columns

so i took x=meshgrid(0:1:40)
and y=(0:1.25:44.25)

Anila