Question: Write a Matlab program that does the following (obviously, the order may need adjustment): Prompt the user for an input file name and read the
Write a Matlab program that does the following (obviously, the order may need adjustment):
Prompt the user for an input file name and read the user's input to a string variable. Do not assume that the file name will be mat1.txt. (In other words, your script should run fine if the user enters a different file name that has data in the same format.) Note that the input function requires a second argument to get strings. Use the help on input to see how this is done. In addition, there is a very nice Matlab function called uigetfile that may be used for this purpose.
Read the data from the file name the user has entered into an array variable. There is more than one way to do this that will work for this type of file.
Use a separate loop to print the array to the console in a neat table. The output should show 4 digits to the right of the decimal place and use no more than 10 characters for each number.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
