Algorithm for subfunction, MATLAB in Engineering

Algorithm for subfunction:

The algorithm for subfunction askforn is as shown:

  •  Prompt the user for the positive integer n.
  •  Loop to print an error message and reprompt awaiting the user enters a positive integer.
  •  Return the positive integer n.

 

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







Related Discussions:- Algorithm for subfunction, Assignment Help, Ask Question on Algorithm for subfunction, Get Answer, Expert's Help, Algorithm for subfunction Discussions

Write discussion on Algorithm for subfunction
Your posts are moderated
Related Questions
Logical scalar values: The MATLAB also has or and and operators which work element wise for the matrices: These operators will compare any of the two vectors or matric

Built-in colormaps: The MATLAB has numerous built-in colormaps which are named; the reference page on colormap shows them. Calling the function colormap without passing any ar

Illustration of Set operations: For illustration, given the vectors as shown below: >> v1 = 2:6 v1 = 2  3  4  5  6 >> v2 = 1:2:7 v2 = 1  3  5  7

Solving 2 × 2 systems of equations: However this may be easy in a MATLAB, in normal finding solutions to the systems of equations is not. The systems which are 2 × 2 are, thou

Program to Counting in a while loop: The script initializes variable counter to 0. Then, in the while loop action, each and every time the user successfully enter a number, th

Execute a exponential function program: Running the script will take up the menu as shown in the figure: Then, what happens will totally depend on which button(s) the

Example of Menu driven modular program: As an illustration of such a menu-driven program, we will write a program to discover the constant e. The constant e, known as the n

Set Operations: The MATLAB has numerous built-in functions which perform set operations on vectors. These involve intersect, union, setdiff, unique, and setxor. All these func

Reading from a File in a While Loop: Though in most languages the combination of a loop and an if statement would be essential to determine whether or not the elements in a ve

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