필터 지우기
필터 지우기

making map in matlab

조회 수: 2 (최근 30일)
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016년 4월 27일
댓글: Chad Greene 2016년 4월 28일
if true
% code
end
I have longitude,latitude and rainfall like that
77.245 31.465 427.94
77.195 31.465 427.92
77.145 31.465 427.79
77.095 31.465 428.06
77.045 31.465 428.23
76.995 31.465 267.87
76.945 31.465 268.11
76.895 31.465 268.18
77.445 31.515 311.14
77.395 31.515 314.24
77.345 31.515 312.6
77.295 31.515 312.42
77.245 31.515 326.54
77.195 31.515 325.4
77.145 31.515 312.24
77.095 31.515 320.51
77.045 31.515 339.76
76.995 31.515 408.82
76.945 31.515 409.66
76.895 31.515 578.72
76.845 31.515 578.37
76.795 31.515 578.15
76.495 31.515 100.37
76.445 31.515 383.13
77.545 31.565 1035.7
77.495 31.565 93.819
77.445 31.565 305.56
77.395 31.565 308.28
77.345 31.565 312.08
77.295 31.565 312.76
77.245 31.565 311.08
77.195 31.565 310.44
77.145 31.565 312.58
77.095 31.565 322.01
77.045 31.565 343.49
76.995 31.565 409.37
76.945 31.565 410.05
76.895 31.565 579.17
76.845 31.565 578.51
76.795 31.565 578.49
76.595 31.565 579.08
76.545 31.565 148.36
76.495 31.565 100.34
76.445 31.565 100.36
76.395 31.565 383.23
There are 555 values.According to one latitude longitude are changing.The third column is rainfall.I have to create a map of rainfall from this in matlab. How it is possible.
  댓글 수: 2
KSSV
KSSV 2016년 4월 27일
You said 555 values, is the data given above complete? If not attach it as a text file.
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016년 4월 28일
Sir I attach a full length file of 555 values.

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

채택된 답변

Chad Greene
Chad Greene 2016년 4월 27일
편집: Chad Greene 2016년 4월 27일
It looks like your data already conform to an evenly-spaced grid, even though they're columnated. That's good, because it means using scatteredInterpolant is overkill. I'd use xyz2grid, which is easier to code, computationally more efficient, and does not make up any data. Let's call the matrix you posted A:
A = [77.245 31.465 427.94
77.195 31.465 427.92
77.145 31.465 427.79
. . .
. . .
. . .
76.395 31.565 383.23];
[lon,lat,rainfall] = xyz2grid(A(:,1),A(:,2),A(:,3));
pcolor(lon,lat,rainfall)
shading flat
borders('countries')
That last line is optional, it's just a way to plot national borders with a function found on File Exchange.
  댓글 수: 3
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016년 4월 28일
Sir It's so helpful.Image is coming perfectly.
Chad Greene
Chad Greene 2016년 4월 28일
Great, I'm glad it's working.

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

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2016년 4월 27일
Let X - your data - array [555 x 3]
F = scatteredInterpolant(X(:,1),X(:,2),X(:,3));
a = min(X(:,1:2));
b = max(X(:,1:2));
[ii,jj] = ndgrid(linspace(a(1),b(1),1000), linspace(a(2),b(2),1000));
out = F(ii,jj);

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by