How to get the index of a value in a table?

370 ビュー (過去 30 日間)
EM
EM 2019 年 9 月 22 日
コメント済み: Mohamad Alkhalidi 2020 年 9 月 24 日
Hi everyone,
I'm new into Matlab.
I have a table T with let's say 2000 raws in one column. Values in the table are not similar.
I want to get the index of an especific value. How can I do that?
Thank you

採用された回答

madhan ravi
madhan ravi 2019 年 9 月 22 日
編集済み: madhan ravi 2019 年 9 月 22 日
index = find(TABLE{:,:}==specific_value)
%or
[~,index] = ismember(specific_value,TABLE{:,:})
If you're dealing with decimals you need to use ismembertol().
  3 件のコメント
madhan ravi
madhan ravi 2019 年 9 月 22 日
Yes a scalar.
Mohamad Alkhalidi
Mohamad Alkhalidi 2020 年 9 月 24 日
How to do the same if my value is a date? i.e., 01/01/2020

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by