Question: Problem 2 Complete the function MiniProject 1 . For a given array of numbers, return the numbers within the range - 2 x 6 ,
Problem
Complete the function MiniProject For a given array of numbers, return the numbers within the range and also return the positions of the selected numbers
within the array.
The input argument
arrayNumbers: is a D doubleprecision row array.
The output arguments:
numbers: a D row array containing the numbers within the range
indices: a D 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 to the numbers of elements in the input array. Then, apply the logical indexing array on this array.
Example :
Inputs:
arrayNumbers
calling the function:
numbers indexes FindNumbers arrayNumbers
Outputs:
numbers double
indices double
The array ind ices indicates that the was in the st Position, the was in the rd Position, and the s were in the th and th positions.
Note: Problem and
separate functions
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
