selecting rows from column vectors

2 ビュー (過去 30 日間)
desert_scientist90
desert_scientist90 2020 年 7 月 17 日
コメント済み: desert_scientist90 2020 年 7 月 19 日
Hi all, I have 10 column vectors with 52,520 observations. I want to extract expecfic observation rows per column vectors, I am trying to use the following code without any luck ( getting a 0*10 table). Is there any reference or other way to do this I can look to?
Thanks in advance
load mpw %dataset
h103 = mpw(mpw.hid=='103',:); %103 is the sample ID across 512 rows * 10 columns ( on this step I am getting a 0*10 table
h103(1:512,{'v1','v2','temp1','temp2','rh1','rh2'});

採用された回答

madhan ravi
madhan ravi 2020 年 7 月 17 日
mpw.hid=='103'
With
strcmp(mpw.hid,'103')
  2 件のコメント
madhan ravi
madhan ravi 2020 年 7 月 17 日
Or use ismember() if you’re using an older version.
desert_scientist90
desert_scientist90 2020 年 7 月 19 日
Thanks,this is a life saver!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by