Area weighting giving too low answers

I am trying the code below in order to area weight my data. The data looks good except it is 5 orders of magnitude lower than I want or expected. I have tried modifying a few things but can't seem to get it to work. Can anyone see where I have gone wrong?
[x,y]=meshgrid(0:1:360,-66:1:66);
x=x(1:end-1,1:end-1); y=y(1:end-1,1:end-1);
weight = cos(y(:,1));
wrepa = repmat(weight,[1 120 663]);
wrepa = permute(wrepa,[3 1 2]);
aa = areaquad(y(:,1)-(1/2),y(:,1)*0,y(:,1)+(1/2),(y(:,1)*0)+1);
repa = repmat(aa,[1 120 663]);
repa = permute(repa,[3 1 2]);
b = sum(aa)*360;
AMW = AM.*wrepa;
AMWW = AMW.*(repa/b);
AMWW = nanmean3d(AMWW,1);
AMWms = (smooth(AMWW,12));
AMWms = 663x132x120;
with values between 1 to -2 spatially.
thanks, Michael

댓글 수: 6

Michael
Michael 2014년 8월 6일
so basically, I get answers 10^-8 rather than 10-03....
Michael
Michael 2014년 8월 6일
10^-03
Michael
Michael 2014년 8월 6일
so my aim is to weight my gridded data with respect to area. My grid resolution is 132 x 120.
What is the variable "AM" in your code?
Michael
Michael 2014년 8월 6일
AM is the pre-weighted data with same dimensions as AMWms
Michael
Michael 2014년 8월 7일
Can anyone help me?

댓글을 달려면 로그인하십시오.

답변 (1개)

Michael
Michael 2014년 8월 7일

0 개 추천

Can anyone help me?

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

질문:

2014년 8월 6일

답변:

2014년 8월 7일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by