extracting data from set of data

2 ビュー (過去 30 日間)
Zakarya Haidari
Zakarya Haidari 2022 年 5 月 17 日
コメント済み: Zakarya Haidari 2022 年 5 月 26 日
hi there so i have this set of data :
all_data1 = importdata("owid-covid-data_2020-21.csv");
num_data1 = all_data1.data;
text_data1 = all_data1.textdata;
days_tarcked= num_data1(:,1);
total_case= num_data1(:,2);
total_death= num_data1(:,3);
code_id = string(text_data1((2:end),1));
continent = string(text_data1((2:end),2));
location_countries = string(text_data1((2:end),3));
data_countries = string(text_data1((2:end),4));
that is about the days tracked by different countries for tracking there number of cases, and im trying to extract the countries that didnt have at leaset 396 entries for there days track from variable days track and location_countries.
any hint or suggestions will be appreciated.
  2 件のコメント
KSSV
KSSV 2022 年 5 月 18 日
Attach your data and tell us what you want. It can be achieved with few steps depending on how data is and how it is read.
Zakarya Haidari
Zakarya Haidari 2022 年 5 月 20 日
so if you have look at the excel sheet, there are

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

回答 (1 件)

David Hill
David Hill 2022 年 5 月 20 日
t=readtable('owid-covid-data_2020-21.csv');
u=unique(t.Location);
count=0;
for k=1:length(u)
m=movsum(diff(t.TotalCases(ismember(t.Location,u(k)))),3);
if all(m<396)
count=count+1;
C{count}=u{k};
end
end
  1 件のコメント
Zakarya Haidari
Zakarya Haidari 2022 年 5 月 26 日
sir, your are a legend

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

カテゴリ

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