extract a cell depending on the value of a variable

조회 수: 1 (최근 30일)
alpedhuez
alpedhuez 2020년 12월 16일
댓글: alpedhuez 2020년 12월 21일
Suppose I have a 2*1 cell T. T{1} is of the form
date city visitors
--------------------
January 1 2020 NY 100
January 2 2020 NY 50
T{2} is of the form
date city visitors
--------------------
January 1 2020 SF 40
January 2 2020 SF 30
Then I want to extract a cell of 'SF" not using T{2} but using the value of the city. How?
  댓글 수: 3
Image Analyst
Image Analyst 2020년 12월 21일
No answer after 4 days? Come on, you certainly know by now that you can get a faster answer if you give us code to create your table or attach it in a .mat file. I'll wait until then. I'm pretty sure I've given this link to you before but this time read it and accept its advice:
In the meantime try contains() or ismember().
alpedhuez
alpedhuez 2020년 12월 21일
Thank you. I had resolved the issue one way or the other.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by