covid data in matlab

i have done the first task but unable to do all other task becuse i donot understand how to find the avg_day and how to subtract the state data from the sheet plz help

14 Comments

People are not categories of knowledge. Please go back and adjust your Tags to represent topics rather than people.
avg_days is a scalar positive integer that is an input. It is the number of days at a time that you are to take a moving average for. The assignment says specifically you can use movmean() to take the moving average.
i amusing it but getting error ,how i can use movmean to get avg_days
and second question is how i remove the data of states from file as asked in assignment
You cannot use movmean to get avg_days . avg_days is a number like 7 or 14 indicating the number of days at a time to take the average over.
avg_days should be an input to movmean, like
world_smoothed = movmean(world, avg_days);
here what is 'world'
is it array whose movmean is to find?
now i have to plot the days vs globalydeaths
day 1*430 while globalydeaths1*429
vector must be of same length
no what should i do
daily_smooth = movmean(dailydeaths, avg_days);
plot(days(1:end-1), daily_smooth);
title('smoothed daily')
days(1*430)size
dailysmooth(332*429)size
error occuring
>> Untitled
Error using plot
Not enough input arguments.
Error in Untitled (line 7)
plot(days(1:end-430), daily_smooth);
daily_smooth = movmean(dailydeaths, avg_days, 2);
ncol = size(daily_smooth,2);
plot(days(1:ncol), daily_smooth)
thanks sir i have done
help me in task 3
elaborate it
Note: your instructions say you would instead need to use
daily_smooth = movmean(dailydeaths, [avg_days-1, 0], 2);
ncol = size(daily_smooth,2);
plot(days(1:ncol), daily_smooth)
this task has been done thanks sir for your kind guidence
elaborate the task 3 in the assignment that i attched in the task descriptionat the top
If you do not understand what is being asked of you, you should probably talk to the TA or to other people in your class about what is expected for that part. We are here to help you understand MATLAB, not to read your assignments for you.

Sign in to comment.

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 26 May 2021

0 votes

Hi,
Have you managed to import data into matlab workspace? If not, you can employ: (1) readtable() or (2) xlsread(). The latter one is slower and not recommended.
Once you import data, you can rename columns of data via different variable names so you can manipulate easier your imported data.
To compute the average of column or row data can be done with mean().
Good luck.

4 Comments

i have imported it to work space ,donot understand how to get avg_days as asked in task no2
avg_days is not to be computed. It is something you input. For example if you want a 7 day moving average, then you would input 7.
Delete EVERY call to "clear all"
There is only one time to call "clear all" inside code, which is if you create a script to run to reset your MATLAB as close as possible to its initial state, to be used only when you finish with one task and want to go on to a different task without quitting MATLAB and re-entering MATLAB. If you would not willingly quit MATLAB at the point you have "clear all" (other than because it is inconvenient) then you should not have "clear all" in the code at all.
ok

Sign in to comment.

Categories

Asked:

on 26 May 2021

Commented:

on 27 May 2021

Community Treasure Hunt

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

Start Hunting!