BEST代写-线上留学生作业代写 & 论文代写专家

成立于2015年的老牌留学生代写品牌-BEST代写提供超过百门冷热门留学学科的作业和论文代写服务。全网BEST原创,高质,准时的留学生代写。

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

评论已关闭。