Question

How to spread the COVİD 19 virus worldwide in the MATLAB using the interpolation method,please help...

How to spread the COVİD 19 virus worldwide in the MATLAB using the interpolation method,please help me???

Can you explain the code...
0 0
Add a comment Improve this question Transcribed image text
Answer #1
s = dir("*.csv"); s = s(arrayfun(@(x) ~matches(x.name,"2019_nCoV_data.csv"), s)); filenames = arrayfun(@(x) string(x.name), s) 
filenames = 6×1 string array "COVID19_line_list_data.csv" "COVID19_open_line_list.csv" "covid_19_data.csv" "time_series_covid_19_confirmed.csv" "time_series_covid_19_deaths.csv" "time_series_covid_19_recovered.csv" 
  • covid_19_data.csv - this is the main file - daily level data of global cases by province/state, from Jan 22, 2020
  • time_series_covid_19_confirmed.csv - time series data of confirmed cases
  • time_series_covid_19_deaths.csv - time series data of cumulative number of deaths
  • time_series_covid_19_recovered.csv - time series data of cumulative number of recovered cases
  • COVID19_line_list_data.csv - individual level information
  • COVID19_open_line_list.csv - individual level information

Mapping Confirmed Cases Globally

Let's visualize the number of confirmed cases on a map. We start by loading time_series_covid_19_confirmed.csv which contains latitude and longitude variables we need for mapping. I also decided to keep the variable names as is, rather than letting MATLAB convert them to valid MATLAB identifiers, because some of the column names are dates.

opts = detectImportOptions(filenames(4), "TextType","string"); opts.VariableNamesLine = 1; opts.DataLines = [2,inf]; opts.PreserveVariableNames = true; times_conf = readtable(filenames(4),opts); 

The dataset contains Province/State variable, but we want to aggregate the data at the Country/Region level. Before we do so, we need to clean up the data a bit. Please note that I have use the () notation because the variable names are not valid MATLAB identifiers.

times_conf.("Country/Region")(times_conf.("Country/Region") == "China") = "Mainland China"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Czechia") = "Czech Republic"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Iran (Islamic Republic of)") = "Iran"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Republic of Korea") = "Korea, South"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Republic of Moldova") = "Moldova"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Russian Federation") = "Russia"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Taipei and environs") = "Taiwan"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Taiwan*") = "Taiwan"; times_conf.("Country/Region")(times_conf.("Country/Region") == "United Kingdom") = "UK"; times_conf.("Country/Region")(times_conf.("Country/Region") == "Viet Nam") = "Vietnam"; times_conf.("Country/Region")(times_conf.("Province/State") == "St Martin") = "St Martin"; times_conf.("Country/Region")(times_conf.("Province/State") == "Saint Barthelemy") = "Saint Barthelemy"; 

Now we can use groupsummary to aggregate the data by Country/Region by summing the confirmed cases and averaging the latitudes and longitudes.

vars = times_conf.Properties.VariableNames; times_conf_country = groupsummary(times_conf,"Country/Region",{'sum','mean'},vars(3:end)); 

The output contains unnecessary columns, such as sums of latitudes and longitudes or means of confirmed cases. Let's remove those variables, and also remove 'sum_' or 'mean_' prefixes from the variables we keep.

vars = times_conf_country.Properties.VariableNames; vars = regexprep(vars,"^(sum_)(?=L(a|o))","remove_"); vars = regexprep(vars,"^(mean_)(?=[0-9])","remove_"); vars = erase(vars,{'sum_','mean_'}); times_conf_country.Properties.VariableNames = vars; times_conf_country = removevars(times_conf_country,[{'GroupCount'},vars(contains(vars,"remove_"))]); 

Because Mainland China is so disproportionately large, we want to exclude it from our visualization.

times_conf_exChina = times_conf_country(times_conf_country.("Country/Region") ~= "Mainland China",:); vars = times_conf_exChina.Properties.VariableNames; 

Let's use geobubble to visualize the first and the last dates in the dataset. Since the column names of numerica data are dates, I can simply pick the first date and the last date to show the maps together. Please note that geobubble would show a bubble for zero values, and therefore we need to remove rows with zero values if we don't want to show bubbles for zero cases.

figure t = tiledlayout("flow"); for ii = [4, length(vars)] times_conf_exChina.Category = categorical(repmat("<100",height(times_conf_exChina),1)); times_conf_exChina.Category(table2array(times_conf_exChina(:,ii)) >= 100) = ">=100"; nexttile tbl = times_conf_exChina(:,[1:3, ii, end]); tbl(tbl.(4) == 0,:) = []; gb = geobubble(tbl,"Lat","Long","SizeVariable",vars(ii),"ColorVariable","Category"); gb.BubbleColorList = [1,0,1;1,0,0]; gb.LegendVisible = "off"; gb.Title = "As of " + vars(ii); gb.SizeLimits = [0, max(times_conf_exChina.(vars{length(vars)}))]; gb.MapCenter = [21.6385 36.1666]; gb.ZoomLevel = 0.3606; end title(t,["COVID-19 Confirmed Cases outside Mainland China"; ... "Country/Region with 100+ cases highlighted in red"])
Add a comment
Know the answer?
Add Answer to:
How to spread the COVİD 19 virus worldwide in the MATLAB using the interpolation method,please help...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • COVID 19 and DNA molecule? What kind of virus is COVID - 19? What does that...

    COVID 19 and DNA molecule? What kind of virus is COVID - 19? What does that mean in terms of what processes happen inside the cells for it to spread to other cells inside the body? Explain the significance of this observation. The average length of a transcription unit along a eukaryotic DNA molecule is about 8000 nucleotides, whereas an average sized protein is about 400 amino acids long.

  • please help in all sections asap!! 1. Summarize what is currently known about the Covid-19 virus...

    please help in all sections asap!! 1. Summarize what is currently known about the Covid-19 virus itself. Think about the topics that are cover inch 13 and the side notes NOT THE SYMPTOMS 2. Discuss the timeline of the development of the Covid-19 pandemic, define phases or stages of its progression (Use of specific terms] 3. If you were the first to discover this novel is, how would you use geromics to understand Covid-19 and the pandemic? - TH

  • In 2020, Corona virus (COVID-19) has spread in many countries, which cancelled or postponed many events...

    In 2020, Corona virus (COVID-19) has spread in many countries, which cancelled or postponed many events around the world. How did companies and universities benefit from telecommunication networks to counter the virus spreading among everyone involved? Provide real life examples. In your opinion, how would it be possible to conduct online final exams?

  • This is all on COVID 19 and viruses What is/are the symptom(s) of COVID-19? fever cough...

    This is all on COVID 19 and viruses What is/are the symptom(s) of COVID-19? fever cough shortness of breath all of the above Question 2 What group(s) is most at risk from COVID-19? (Choose all that apply) Infants people 20-60 People 60 and older People with severe health conditions. QUESTION 3 A virus enters a cell to get food replicate DNA or RNA get water make a person sick QUESTION 4 What are two symptoms of a severe case of...

  • You want to make a live virus vaccine against the COVID-19 virus by using zoonotic coronaviruses,...

    You want to make a live virus vaccine against the COVID-19 virus by using zoonotic coronaviruses, i.e. coronaviruses that currently infect other species and therefore grow poorly in humans. i) What is the advantage of using a virus for the vaccine instead of just injecting spike protein from the COVID-19 virus ii) You obtain the DNA sequence of two coronaviruses that infect bats or foxes. The partial sequence of the spike protein from the human virus, and from these two...

  • Can you conduct some research on how you think the COVID-19 virus impacts the US economy,...

    Can you conduct some research on how you think the COVID-19 virus impacts the US economy, and if this rate cut is enough to hold the US economy aside from a recession? Please provide a specific analysis of how this virus can impact all components of GDP (C, I, G and Net exports)

  • The Coronavirus COVID-19 pandemic and social distancing efforts to slow the spread of this virus have...

    The Coronavirus COVID-19 pandemic and social distancing efforts to slow the spread of this virus have resulted in an unprecedented global economic downturn. Many governments around the world have implemented different fiscal and monetary policy responses with the goal of reducing the impacts of the recession on their citizens. Provide a short discussion (maximum of 3 paragraphs) about one specific policy intervention that interests you, which has been considered or implemented by the Government of Canada or another county. This...

  • 1. What type of virus is Covid 19? An RNA Virus? A DNA Virus? a. Where...

    1. What type of virus is Covid 19? An RNA Virus? A DNA Virus? a. Where is the virus thought to have originated in China? b. How is the virus passed from person to person (we think)? c. Why do you think older people are so severely affected by this virus (Besides just the fact they are older and may be in poorer health)?

  • How do you see the COVID-19 Corona virus changing health care in the future?

    How do you see the COVID-19 Corona virus changing health care in the future?

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT