Write a script and a function to implement the secant


Preliminary Information

In this assignment you will write a script and a function to implement the secant algorithm.

The function will implement the secant algorithm and return the root of the function.

The script will define the required data and send the data to the function. Included in the required data there should be a string that defines the required function as an anonymous function. The string can be converted into a function handle using MATLAB's str2func function.

After the root is returned from the secant function is should be written to a data file on disk with 6 decimal places. The data file should read:

The root = (value_of_root)

For your function use

f(x) = 2-2log?(x)-√x

Goals:

  • Writing numerical analysis software
  • The use of anonymous functions
  • I/O to disk files

Reading Assignment: Recommended reading from MATLAB help documentation:

• str2func
• fopen
• fprintf
• fclose

Note: you should write the output to a file in your current directory.

What to Submit

You are required to upload the following files to Blackboard

1) Your script M-file.
2) Your secant function M-file.
3) A documentation file.

You should note that your documentation file is extremely important. It is this information that users of your software will consult when running your software. Too many programmers make extreme efforts writing and testing software and then fail to provide proper documentation. This hinders the use of your software and prevents users from gaining the full benefits of your hard work.

All you M-file should contain comments explaining how the program works. In addition, you should include the follows:

File name
Description
Program variables
Programmer
Student number
Date

Your documentation file should contain the following information:

Programmer
Student number
Date
File software names of all your programs
Description of program
Instructions on how to run the program

Request for Solution File

Ask an Expert for Answer!!
Mathematics: Write a script and a function to implement the secant
Reference No:- TGS01276310

Expected delivery within 24 Hours