Question: 3 . Create a MATLAB function named vectorAnalysis that takes a vector as input and performs the following tasks: a . Calculate the mean, median,

3. Create a MATLAB function named vectorAnalysis that takes a vector as input and performs the following tasks:
a. Calculate the mean, median, standard deviation, and range of the vector.
b. Identify and return the indices of the maximum and minimum values in the vector.
c. Determine and return the first and last occurrence of the most frequently appearing element in the vector.
Test the function with two different vectors: v1=[15,22,15,8,-3,15,7,22] and v2=[3.5,-1.8,3.5,7.2,-4.6,2.9,3.5,-1.8]. Include in your submission the function definition, the test code, and the results for both vectors.

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!