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 件のコメント

Walter Roberson
Walter Roberson 2021 年 5 月 26 日
People are not categories of knowledge. Please go back and adjust your Tags to represent topics rather than people.
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
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.
Muhammad
Muhammad 2021 年 5 月 26 日
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
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
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);
Muhammad
Muhammad 2021 年 5 月 26 日
here what is 'world'
is it array whose movmean is to find?
Muhammad
Muhammad 2021 年 5 月 26 日
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
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
編集済み: Walter Roberson 2021 年 5 月 26 日
daily_smooth = movmean(dailydeaths, avg_days);
plot(days(1:end-1), daily_smooth);
title('smoothed daily')
Muhammad
Muhammad 2021 年 5 月 26 日
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);
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
daily_smooth = movmean(dailydeaths, avg_days, 2);
ncol = size(daily_smooth,2);
plot(days(1:ncol), daily_smooth)
Muhammad
Muhammad 2021 年 5 月 26 日
thanks sir i have done
help me in task 3
elaborate it
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
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)
Muhammad
Muhammad 2021 年 5 月 26 日
this task has been done thanks sir for your kind guidence
Muhammad
Muhammad 2021 年 5 月 26 日
elaborate the task 3 in the assignment that i attched in the task descriptionat the top
Walter Roberson
Walter Roberson 2021 年 5 月 27 日
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.

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

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 5 月 26 日

0 投票

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 件のコメント

Muhammad
Muhammad 2021 年 5 月 26 日
i have imported it to work space ,donot understand how to get avg_days as asked in task no2
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
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.
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
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.
Muhammad
Muhammad 2021 年 5 月 26 日
ok

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

カテゴリ

ヘルプ センター および File ExchangeChemical Process Design についてさらに検索

質問済み:

2021 年 5 月 26 日

コメント済み:

2021 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by