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
2021 年 5 月 26 日
People are not categories of knowledge. Please go back and adjust your Tags to represent topics rather than people.
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
2021 年 5 月 26 日
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
2021 年 5 月 26 日
Muhammad
2021 年 5 月 26 日
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
2021 年 5 月 26 日
Walter Roberson
2021 年 5 月 26 日
daily_smooth = movmean(dailydeaths, avg_days, 2);
ncol = size(daily_smooth,2);
plot(days(1:ncol), daily_smooth)
Muhammad
2021 年 5 月 26 日
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
2021 年 5 月 26 日
Muhammad
2021 年 5 月 26 日
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
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
2021 年 5 月 26 日
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
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
2021 年 5 月 26 日
カテゴリ
ヘルプ センター および File Exchange で Chemical Process Design についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!