Finding precipitation of specific coordinate matrix

2 views (last 30 days)
Hi, I have a precipitation data that includes 3 columns. First column shows latitudes, second column shows longitudes and last one shows precipitation values. Suppose, I have A matrix:
A = 36 35 100
36 34 78
36 33 42
36 32 51
35 35 83
35 34 72
35 33 80
Here each columns show lat, lon and precipitation values of big region. But I want to extract precipitation values of specific B matrix that is shown below.
B= 36 33
36 32
35 33
so the precipitation values of that coordinates should be equal to R= 42, 51, 80. How can I wrote this code in matlab ? Thanks for your help.

Accepted Answer

David Fletcher
David Fletcher on 9 May 2021
A = [36 35 100;
36 34 78;
36 33 42;
36 32 51;
35 35 83;
35 34 72;
35 33 80 ; ]
index=(A(:,3)==42|A(:,3)==51|A(:,3)==80)
selction=A(index,1:2)
  5 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Weather and Atmospheric Science in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by