フィルターのクリア

Find data in a matrix

2 ビュー (過去 30 日間)
SSM
SSM 2021 年 3 月 26 日
コメント済み: DGM 2021 年 3 月 26 日
I have a 517x401 meteorological data matrix containing values between 0 to 1. The latitude and longitude vectors are 401x1 and 517x1 respectively.
I want to find data with values greater than 0.5, and the corresponding latitude and longitude values.
Using find() to do this yields an index vector that does not serve the purpose. What is an appropriate way to do this?
Thanks.
  3 件のコメント
Rik
Rik 2021 年 3 月 26 日
What code are you using? For 2D data you don't even need ind2sub.
DGM
DGM 2021 年 3 月 26 日
Rik is right. I forgot find() supports both syntaxes:
linearindices=find(X);
and
[rowsubs colsubs]=find(X);

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

採用された回答

KSSV
KSSV 2021 年 3 月 26 日
[X,Y] = meshgrid(lon,lat);
idx = A>0.5 ; % A is your data
iwant = [X(idx) Y(idx) A(idx)] ;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by