Question: In many applications it is useful to normalize a vector of values stored in an array There are various different ways to do this. In

 In many applications it is useful to normalize a vector of

In many applications it is useful to normalize a vector of values stored in an array There are various different ways to do this. In this problem we define a normalization technique and ask you to write functions to implement and test this technique. The normalization we define, sets the minimum value in the vector to 0. the maximum to 1 and scales all the other values accordingly. If the original vector is x. each element of the scaled vector x' is defined by the following formula x'_k = x_k - x_min/x_max - x_min where x_min is the smallest value in x and x_max is the largest value in x. For example if the original vector is {2.5, 7.2, 8.4, -3.2, 9.2, -1.9} The normalized vector is {0.4597, 0.8387, 0.9355, 0.0000, 1.0000, 0.1048} (a) Write the definition for a C function named minmax. The function should have four parameters, the array to be normalized, the size of the array, the minimum value and the maximum value. The array should be of type double. This function should compute and determine the minimum and maximum values in the given array. (b) Write the definition for a C function named normalize. This function has two parameters, the given array (of type double) and its size. It normalizes the given array Your function must use the minmax function defined in part (a). (c) Write a main program that tests the normalize function as follows. Read the size of an array. N, and then generate an array of N random double values in the range between -25.0 and 175.0. It should then normalize this array and output the normalized array

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!