Question: in matlab please! Question 1: Implement the following algorithm in a script file. Save the script file as lastnameChallengeA3Q1. a. Ask the user to enter
Question 1: Implement the following algorithm in a script file. Save the script file as lastnameChallengeA3Q1. a. Ask the user to enter a column vector of any size. b. Calculate the mean of the values of the column vector c. Display the mean of the values. Question 2: Implement the following algorithm in a script file. Save the script file as lastnameChallengeA 3Q2. a. Ask the user to enter a column vector of any size. b. Use a for loop to calculate the square of all values and store them in a new vector, one value at a time. Make sure to preallocate the variable for speed. c. Display the squared vector. Question 3: Implement the following algorithm in a script file. Save the script file as lastnameChallengeA 3Q3. a. Define two column vectors using the randi function. Name the vectors, vecl and vec2. The values of the elements in the vectors should be between 1 and 50 . b. Calculate the mean of the each of the vectors and store them in separate variables. c. Compare the means of the two vectors. If the mean of vector 1 is greater than mean of vector2, display: mean of vector 1 is greater than mean of vector 2. Similarly, If the mean of vector 2 is greater than mean of vectorl, display: mean of vector 2 is greater than mean of vector 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
