interpolate a 2D matrix with nonmatching dimnsions

interpolate a 2D matrix with nonmatching dimnsions

Post by anila ale » Tue, 02 Mar 2010 21:00:22


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
Please Help.
Thanks for your time
Anila
 
 
 

interpolate a 2D matrix with nonmatching dimnsions

Post by Matt » Tue, 02 Mar 2010 21:13:05


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

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

Post by us » Tue, 02 Mar 2010 21:14:05


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

us
 
 
 

interpolate a 2D matrix with nonmatching dimnsions

Post by anila ale » Thu, 04 Mar 2010 13:20:05


This is the syntax
a=meshgrid(0:40);
b=meshgrid(58.75:1.25:101.25);
c=load(fgy);
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

Post by anila ale » Thu, 04 Mar 2010 13:29:05


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