Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
problem in data griding

Subject: problem in data griding

From: Shaik Ghouse Basha

Date: 16 Aug, 2012 12:27:07

Message: 1 of 4

Dear Sir/Friends, I am planing to grid data... I have longitude starting from -180:0.25:180 and latitude from -90:0.25:90 and i have corresponding data matrix. Here my problem is to convert data -180:1:180 and -90:1:90 i.e bringing data from 0.25x 0.25 to 1x1 degree grid. I am using griddata program and my own program , but feature is missing. please help me how to do this, I need this very urgent... Awaiting for your sweet reply...

Subject: problem in data griding

From: Justin Ashmall

Date: 16 Aug, 2012 13:49:08

Message: 2 of 4

"Shaik Ghouse Basha" wrote in message <k0iour$7j0$1@newscl01ah.mathworks.com>...
> I have longitude starting from -180:0.25:180 and latitude from -90:0.25:90 and i have corresponding data matrix. Here my problem is to convert data -180:1:180 and -90:1:90 i.e bringing data from 0.25x 0.25 to 1x1 degree grid. I am using griddata program and my own program , but feature is missing.

Why don't you show us what you've tried?

Subject: problem in data griding

From: Shaik Ghouse Basha

Date: 16 Aug, 2012 14:06:07

Message: 3 of 4

I have used Griddata command in matlab and the below code
lon1=-179.5:1:179.5;
lat1=-40:1:40;

%% rr is my data
Eda=nan(length(lat1),length(lon1));
eps=0.5
for i=1:length(dd)
    P1=find(lat1>=la(i)-eps1 & lat1<=la(i)+eps1);
    Q1=find(lon1>=lo(i)-eps1 & lon1<=lo(i)+eps1);
  
    Eda(P1,Q1)=nanmean([Eda(P1,Q1) rr(i)]);
    
end



"Justin Ashmall" wrote in message <k0itok$j5c$1@newscl01ah.mathworks.com>...
> "Shaik Ghouse Basha" wrote in message <k0iour$7j0$1@newscl01ah.mathworks.com>...
> > I have longitude starting from -180:0.25:180 and latitude from -90:0.25:90 and i have corresponding data matrix. Here my problem is to convert data -180:1:180 and -90:1:90 i.e bringing data from 0.25x 0.25 to 1x1 degree grid. I am using griddata program and my own program , but feature is missing.
>
> Why don't you show us what you've tried?

Subject: problem in data griding

From: Justin Ashmall

Date: 16 Aug, 2012 14:49:08

Message: 4 of 4

"Shaik Ghouse Basha" wrote in message <k0iuoe$pp1$1@newscl01ah.mathworks.com>...
> I have used Griddata command in matlab and the below code
> lon1=-179.5:1:179.5;
> lat1=-40:1:40;
>
> %% rr is my data
> Eda=nan(length(lat1),length(lon1));
> eps=0.5
> for i=1:length(dd)
> P1=find(lat1>=la(i)-eps1 & lat1<=la(i)+eps1);
> Q1=find(lon1>=lo(i)-eps1 & lon1<=lo(i)+eps1);
>
> Eda(P1,Q1)=nanmean([Eda(P1,Q1) rr(i)]);
>
> end
>

This appears to be almost identical to the question you asked in April:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/318713

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us