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
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);
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
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 Exchange에서 Chemical 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