How to get data based on first and second column

2 ビュー (過去 30 日間)
Muhammad Uswah Pawara
Muhammad Uswah Pawara 2018 年 11 月 25 日
コメント済み: dpb 2018 年 11 月 26 日
Hallo, I have matrix (793576x3) that consist of x,y,z, which are x = longitude and y = latitude and z = depth.
I want to get z data only for coordinate x,y (92,8.25),(92.5,8.0).., and so on that means +0.25 for x coordinate and -25 for y coordinate. so the results should be
x y z
92 8.25 -
92.25 8.0 -
92.50 7.75 -

採用された回答

dpb
dpb 2018 年 11 月 25 日
編集済み: dpb 2018 年 11 月 26 日
mxx=max(A(:,1)); % max X coordinate in array
ix=ismember(A(:,1),[92:0.025:mxx]); % locations in A of desired values
B=A(ix,:): % those elements of A
  2 件のコメント
dpb
dpb 2018 年 11 月 26 日
--Answer moved to Comments. dpb--
Thank you very much for your answer. much appriciated
dpb
dpb 2018 年 11 月 26 日
Glad to help; NB: left off the max function on first code line originally...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMapping Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by