フィルターのクリア

How to retrieve the specific rows with all the columns in the dataset?

1 回表示 (過去 30 日間)
Sai Gautam Mandapati
Sai Gautam Mandapati 2022 年 8 月 10 日
コメント済み: KSSV 2022 年 8 月 10 日
Hi everyone,
I have dataset which has 2832 rows and 4 columns. In this specific dataset I want to retrieve two rows, for example in the image provided for time instant 1.5 I want to get the two values of number of packets for both cachehits and cachemisses and further to the retrieved values I want to implement the formula of Hitratio = (Cachehits)/(CacheHits+CacheMisses) *100 and get the value of hit ratio.

採用された回答

KSSV
KSSV 2022 年 8 月 10 日
I hope the dataset is in the form of a table. So your table is going to be of size 2832x4.
idx = T.Time==1.5 ;
T1 = T(idx,:) ;
T1.(1)
T1.Node
T1.Type
You can access your required from T1.
  6 件のコメント
Sai Gautam Mandapati
Sai Gautam Mandapati 2022 年 8 月 10 日
Thanks, that works fine. I just have one more question. In the code above why have you declared T1. (1)? Can you please explain? Thank you so much.
KSSV
KSSV 2022 年 8 月 10 日
Read about table. If you want to access the first column, either you can use T.Time or T.(1). 1 stands for first column.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by