BEST代写-线上编程学术专家

Best代写-最专业靠谱代写IT | CS | 留学生作业 | 编程代写Java | Python |C/C++ | PHP | Matlab | Assignment Project Homework代写

Matlab代写 | Maths 162 Semester 2, 2020 Assignment 4: Randomness and Modelling

Matlab代写 | Maths 162 Semester 2, 2020 Assignment 4: Randomness and Modelling

这个作业是用Matlab模拟奥克兰的降雨量

Maths 162 Semester 2, 2020
Assignment 4: Randomness and Modelling

Problems
1. In this problem, you’re going to simulate the amount of rainfall in Auckland! Specifically,
you’re going to write a MATLAB function named rainfall that takes in as input a number
of days n and outputs the total amount of rain simulated over those n days. To do this: first,
initialize a set of values totalrain = 0 and rainchancem = −25. Then, do the following n
times, once for each day simulated:
ˆ Create a random value israin by using a normal distribution with mean rainchancem
and standard deviation 50.
ˆ If this value is negative, it does not rain on that day. If so, add +1 to rainchancem to
increase the odds that it rains on the next day.
ˆ If this value is nonnegative, create a random value dayrain by using a normal distribution
with mean 10 and standard deviation 8. If this value is nonnegative, this is the amount
of rain on that day; add this value to totalrain. (If this value is negative, do not add
it to totalrain, as negative rain doesn’t make sense.)
If dayrain was positive, add −2 to rainchancem to decrease the odds that it rains on
the next day. Otherwise, add +1 to rainchancem.

bestdaixie

评论已关闭。