Question: Write a MATLAB Script called stats that will ask a user to input a number n(a positive integer) and compute the following: a. msq= the

Write a MATLAB Script called stats that will ask a user to input a number n(a positive integer) and compute the following: a. msq= the mean of the squares of the first n positive integers b. m= The mean of the first n positive numbers c. sm= The sum of the first n positive numbers. For example, if n is 5, your MATLAB Script needs to compute msq as the average of the numbers 1, 4, 9, 16, and 25. You may use any built-in MATLAB functions including, for example, sum. Display the sum, the mean and the mean square. Run your program four times with the following values of n: 5, 15, 25, and 35 and present your results.

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!