Example exit modular program, MATLAB in Engineering

Example Exit modular program:

In the illustration below, the user

  •  Chose the Limit;

-   Whenever prompted for n, entered the two invalid values before finally entering a valid positive integer.

  •  Chose the Exit Program.

>> eapplication

Enter a positive integer for n: -4

Invalid! Enter a positive integer: 5.5

Invalid! Enter a positive integer: 10

An approximation of e with n = 10 is 2.59

In order to view the distinction in the approximate value for e as n increases, the user kept choosing Limit & entering larger and larger values each time in the illustration below:

>> eapplication

Enter a positive integer for n: 4

An approximation of e with n = 4 is 2.44

Enter a positive integer for n: 10

An approximation of e with n = 10 is 2.59

Enter a positive integer for n: 30

An approximation of e with n = 30 is 2.67

Enter a positive integer for n: 100

An appoximation of e with n = 100 is 2.70

Posted Date: 10/19/2012 8:40:40 AM | Location : United States

Related Discussions:- Example exit modular program, Assignment Help, Ask Question on Example exit modular program, Get Answer, Expert's Help, Example exit modular program Discussions

Write discussion on Example exit modular program
Your posts are moderated
Related Questions
IS Functions in Matlab: There are many functions which are built into MATLAB which test whether or not something is true; these function names start with the word is. As these

readlenwid function: function call: [length, width] = readlenwid; function header: function [l,w] = readlenwid In the function call, not any argument is passed; henc

Creating the structure Variables: Creating a structure variable can be accomplished by simply storing the values in fields by using assignment statements, or by using the stru

Binary Search: The binary search supposes that the vector has been sorted first. The algorithm is just similar to the way it works whenever looking for a name in a phone direc

Gauss Elimination: The Gauss elimination technique consists of:    Generating the augmented matrix [A b]    Applying EROs to augmented matrix to obtain an upper trian

Storing Strings in Cell Arrays: The one good application of a cell array is to store strings of various lengths. As cell arrays can store various types of values in the elemen

Illustration of gauss-jordan: Here's an illustration of performing such substitutions by using MATLAB >> a = [1 3 0; 2 1 3; 4 2 3] a = 1 3 0 2 1 3 4 2

Function fieldnames - structure functions: The function fieldnames will return the names of the fields which are contained in the structure variable. >> pack_fields = fiel

Patch function - graphics objects: The patch function is used to generate a patch graphics object, which is made from 2-dimensional polygons. The patch is defined by its verti

Algorithm for the function e: The algorithm for the function eoption is as shown: Use the menu function to show the 4 choices. Error-check (an error would take place