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

조회 수: 352 (최근 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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by