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
function numden: The function numden will return individually the numerator & denominator of a symbolic expression: >> sym(1/3 + 1/2) ans = 5/6 >> [n, d] =

Illustration of Image processing: This displays that there are 64 rows, or in another word, 64 colors, in this specific colormap. It also displays that the first five colors a

deblank function: The deblank function eliminates only trailing blanks from the string, not leading the blanks. The strtrim function will eliminate both the leading and traili

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

Referring to and Showing Cell Array Elements and Attributes: Just as with the other vectors, we can refer to individual elements of the cell arrays. The only difference is tha

Matrix definitions: As we know the matrix can be thought of as a table of values in which there are both rows and columns. The most common form of a matrix A (that is sometime

IS Functions for Strings: There are many functions for strings, that return logical true or false. The function isletter returns the logical true when the character is a lette

Use of Nested if-else statements: By using the nested if-else to select from among the three possibilities, not all the conditions should be tested. In this situation, if x is

Executing a program: Running the program would be completed by typing the name of the script; this would call the other functions: >> calcandprintarea Whenever prompt

Intersect function and setdiff function: The intersect function rather than returns all the values which can be found in both of the input argument vectors. >> intersect(v