Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The file below contains five data points plus additional data. The data is at th

ID: 3785853 • Letter: T

Question


The file below contains five data points plus additional data. The data is at the beginning of the lines, delimited by whitespace. After the data, there will be some explanation as to the meaning of the data. The explanations might not be the same as that shown here, but the order of the lines will always be the same: numbers at the beginning of the line and explanations at the end.

-4 -7.6 Point 1
-2 -17.2 Point 2
0.2 9.2 Point 3
1 -1.6 Point 4
4 -36.4 Point 5
1 xmin
3 xmax
0.2 increment in x

The graph of the function ( ) will pass through all five points if the constants a, b, c, d and e are chosen correctly. After the constants are known, other points along the polynomial can be found by plugging any value of x into the function. For example, an output file could be created containing a table of x and y values that lie on this function:
X Y
1.0000 2.1234
1.2000 3.2834
. . . . . .
3.0000 3.4234

Write a Matlab script to prompt for the input filename, open it and read it. Determine the constants a, b, c, d and e. Construct a vector of x values from xmin to xmax by the increment in x. Determine a y value for each value in the x vector, such that the y values fall on the function. Prompt for an output filename and write your data into the output file. You must have X and Y headings as shown above and the data must be neatly aligned under the headings. Use columns that are 15 characters wide, with 4 digits after the decimal point. Use one space between the columns. Please note that I have an input file with secret numbers that I will use for testing your script. Your script should do its work silently: it will prompt for the filenames, but nothing should be written to the screen after the prompts are issued.

Explanation / Answer

To read the file:

View the contents of the file with the type command.

Write a short table of the exponential function to a text file called exp.txt.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote