Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Help with a MATLAB Code implementation. (PS: Actually, it's not 5 Questions, Please do answer and provide some details for me to understand, please

Please Help with a MATLAB Code implementation. (PS: Actually, it's not 5 Questions, Please do answer and provide some details for me to understand, please i beg )

Task: Use Matlab to realize the bisection method.

Requirements

  • Learn the principle of the bisection method by yourself.
  • Branches, loops, and user-defined functions should be included.
  • Apply the bisection method to acquire the roots of and .
  • The final outputs are the roots of the equations and the number of iterations. Also, the function curves should be plotted.
  • The comment for each statement in your script is necessary.
  • Hand in your report and all your M files.
  1. Principle: Write the principle of the bisection method in detail.
  2. Program Design: How did you design your program? What are the inputs and outputs? How many sections did your program have? How did you design each section? A flow chart is also necessary.
  3. Program Code:
  4. Main program

    Create a data dictionary defining the meanings of all of the variables in your program. For example,

    % a---apple

    % b---banana

    Then write your statements and make sure to add a comment for each statement. For example,

    c=a+b; % to obtain the total amount of apples and bananas

    Function 1

    Comment lines for brief introduction and how to use this function. For example,

    function distance = dist2 (x1, y1, x2, y2)

    %DIST2 Calculate the distance between two points

    % Function DIST2 calculates the distance between

    % two points (x1,y1) and (x2,y2) in a Cartesian coordinate system.

    %

    % Calling sequence:

    % distance = dist2(x1, y1, x2, y2)

    % Define variables:

    % x1 x-position of point 1

    % y1 y-position of point 1

    % x2 x-position of point 2

    % y2 y-position of point 2

    % distance Distance between points

    Statements;% comment

    end

    Function 2

    Function 3

  5. Please Provide Screenshots of program results [The Code Editor with Codes and The function curves OUTPUT)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Discuss the various types of policies ?

Answered: 1 week ago

Question

Briefly explain the various types of leadership ?

Answered: 1 week ago

Question

Explain the need for and importance of co-ordination?

Answered: 1 week ago

Question

Explain the contribution of Peter F. Drucker to Management .

Answered: 1 week ago

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago