Question: Problem 2 Complete the function MiniProject 1 . For a given array of numbers, return the numbers within the range - 2 x 6 ,

Problem 2
Complete the function MiniProject1. For a given array of numbers, return the numbers within the range -2x6, and also return the positions of the selected numbers
within the array.
The input argument
arrayNumbers: is a 1D double-precision row array.
The output arguments:
numbers: a 1D row array containing the numbers within the range -2x6.
indices: a 1D row array containing the positions of the selected values used to produce the numbers output array.
Restrictions: The solution must use logical indexing. Do not use loops or if else statements.
Hints: As loops cannot be used, use the internal function size on the input array (arrayNumbers), and use logical indexing to find the location of the identified numbers in the
input array. To find the positions you could create an array of integers from 1 to the numbers of elements in the input array. Then, apply the logical indexing array on this array.
Example :
Inputs:
arrayNumbers =
-2,8,1,9,3,3,9
calling the function:
[numbers, indexes]= FindNumbers (arrayNumbers)
Outputs:
numbers =14 double
-2,1,3,3
indices =14 double
1,3,5,6
The array ind ices indicates that the -2 was in the 1 st Position, the 1 was in the 3 rd Position, and the 3's were in the 5 th and 6 th positions.
Note: Problem1 and
separate functions
 Problem 2 Complete the function MiniProject1. For a given array of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!