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

450 vues (au cours des 30 derniers jours)
EM
EM le 22 Sep 2019
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

Réponse acceptée

madhan ravi
madhan ravi le 22 Sep 2019
Modifié(e) : madhan ravi le 22 Sep 2019
index = find(TABLE{:,:}==specific_value)
%or
[~,index] = ismember(specific_value,TABLE{:,:})
If you're dealing with decimals you need to use ismembertol().
  3 commentaires
madhan ravi
madhan ravi le 22 Sep 2019
Yes a scalar.
Mohamad Alkhalidi
Mohamad Alkhalidi le 24 Sep 2020
How to do the same if my value is a date? i.e., 01/01/2020

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by