Write a matlab script called estimate_e

Assignment Help MATLAB Programming
Reference no: EM13690923

Problem: The number e can be estimated as an infinite series:

e = 1 +( 1/1) +(1/1?2)+(1/1?2?3)......

Write a MATLAB script called estimate_e where a while loop is used to obtain an estimate of e. Use appropriate logic to terminate the while loop when the relative change between estimates (tol) is less than 1×10-6.

Then, make a plot of the residual between your estimate and the more accurate value from Matlab's built-in function (which can be obtained by calling exp(1)) versus the iteration number. Use the function semilogy to plot your results. Repeat for tol = 1×10-9

Question: How does your actual accuracy compare to the relative tolerance you chose?

Can you provide the answer as soon as possible and use basic MATLAB concepts to make this program?

Reference no: EM13690923

Questions Cloud

Calculates how much a little league baseball team spent : Prepare a program that calculates how much a little league baseball team spent last year to purchase new baseballs.
Categorize the efficiency in terms of the variable : Show in milliseconds the amount of time this construct would require to execute if n were 1000 - Consider the following nested loop construct
Implement function types that takes no input : Implement function types that takes no input, declares 3 variables of type char, 3 of type short, 3 of type int, and 3 of type double.
How to draw a figure of an http get packet : How to draw a figure of an HTTP GET packet that shows the position and size in bytes of the TCP, IP and Ethernet protocol headers.
Write a matlab script called estimate_e : How does your actual accuracy compare to the relative tolerance you chose - Can you provide the answer as soon as possible and use basic MATLAB concepts to make this program?
How deep can the procedure calls go before registers : How deep can the procedure calls go before registers must be saved in memory? (That is, what is the maximum number of "active" procedure calls that can be made before we need to save any registers in memory?)
Implement a program using function for a defined task : Implement a program using function for a defined task. Initial data is read from a file and added from keyboard. Program has to output resulting and initial data.
Define the sums of every even column of 2d array : Define the sums of every even column of 2D array in C language - Prepare this program in c language. Show all your work.
How to use wxpython instead of matplotlib : How to use wxpython instead of matplotlib and

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Construct the shear force and bending moment diagrams

Write the algorithm and draw the flowchart for each problem

  Develop your own matlab function for the fixed-point method

Develop your own Matlab function for the Fixed-point method. Use the approximate relative error as your stopping criterion. The first line of your function should be function [root,froot,ea,iter] = fixedpoint(func,xr,es,maxit)

  Simulate rigid body mechanics

Write a MATLAB code to simulate rigid body mechanics. Create a video file of a free falling rod. Neglect effects from drag or loss of kinetic energy. Make sure the rod falls onto one end showing how the rigid body reacts to hitting the ground. Cannot..

  Create functions in file

Create Functions in File and how to code this function - Declare function inputs, and outputs

  Parking in garage using matlab

In matlab: parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour.

  Calculate the integration along the given path

define the integrand using the given definition as Integrand - Find a parametric representation of C using Matlab

  Create a script file for conversion of temperature

Create a script file for conversion of temperatures. Use the input function or menu function to allow the user to enter temperature scale of Fahrenheit, Celsius, Kelvin, or Rankine. If you are using the input function, tell the user to enter F for Fa..

  Design and fir filter in matlab

What does the pole-zero diagram tells you about the filter

  Write a menu driven matlab script named grades

Write a menu driven Matlab script named grades that will let the user.

  Matlab program which will determine your vehicle fuel usage

Create a MATLAB program which will determine your vehicle fuel usage (MPG, miles/gallon) rating for a user defined number of trips ('for' repetition structure). Review the voiceover supplied for an example of the required input/output from this progr..

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Create from the stack a structure string stac

Design a structure stack that represents a stack of elements of some arbitrary type. Include the functions: create(returns an empty stack), push(add an element to the top of the stack and return the resulting stack), pop(delete the top element and re..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd