Question 2
Write the code for a function called mysteryFunction that takes
in a vector, V, and produces a new vector, W, of the same length as
V where each element of W is the sum of the corresponding element
in V and the previous element of V. Consider the previous element
of V(1) to be 0. E.g. V = [1:6] mysteryFunction(V) should return [1
3 5 7 9 11]
Question 5
Write a PYTHON function d = dsc(c) that takes a one-dimensional
array of numbers c and returns an array d consisting of all numbers
in the array c with all neighbouring duplicated numbers being
removed. For instance, if c = [1 2 2 2 3 1], then d = [1 2 3
1].
Question 2 Write the code for a function called mysteryFunction that takes in a vector, V, and produces a new vector, W,
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 2 Write the code for a function called mysteryFunction that takes in a vector, V, and produces a new vector, W,
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!