Question: n=1 3. Consider the sum 2 S= . 2. n(n+1) (a) Write a function called my_sum_XXXXXX.m where xxxxxx is your candidate number which takes a

n=1 3. Consider the sum 2 S= . 2. n(n+1) (a) Write a function called my_sum_XXXXXX.m where xxxxxx is your candidate number which takes a positive integer input N and returns a vector of elements S1, S2, ..., Sn given by: 2 SN n(n + 1) The function should return an error if N is not a positive integer. (10 marks) N n=1 (b) Create a script called AM10IM_Q3_XXXXXX.m, where xxxxxx is your can- didate number, which calls the function my_sum_XXxxxx for N 50,000. Then store the absolute error of each iteration, |(Si S)), where i ranges from 1 to 50,000, in a vector called errorVec. (5 marks) (c) In your script, add code which finds the first value k for which |(Sk-S)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
