Question: I am mostly having trouble with creating a hw1dat.m file (there wasn't one provided, I have to create one) full of random numbers and then

 I am mostly having trouble with creating a hw1dat.m file (there

I am mostly having trouble with creating a hw1dat.m file (there wasn't one provided, I have to create one) full of random numbers and then reading it into another file so I can use the data to form an array so that it can be averaged. Creating the averaging function isn't the problem. Detailed steps showing how to do this first part (which is supposed to be simple apparently) would be very appreciated.

1) In this exercise,you will write a Matlab program to compute the average of a set of numbers. The numbers are to be found in a data file called hwldat.m. First you must read the data from the data file into your program. Next, you will want your program to determine how many numbers there are to be averaged (call this number n). Then you will want to sum the n numbers. Next, divide the sum by n to compute the average. Finally, you must write your result to an output file called hwlout.m. This output file should contain only the following sentence: The average is xyz, where xyz is your computed average. You may not use the built-in Matlab commands sum, mean, or anything similar

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!