Example of modular program, MATLAB in Engineering

Example of modular program:

In a modular program, there would be one main script which calls three separate functions to complete these tasks:

  • A function to prompt an user and read in the radius
  • A function to compute the area of a circle
  • A function to show the results

As both the scripts and functions are stored in M-files, there would be four individual M-files together for this program; one M-file script and three M-file functions, as shown below:

1855_Example of modular program.png

650_Example of modular program1.png

411_Example of modular program2.png

 

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







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

Write discussion on Example of modular program
Your posts are moderated
Related Questions
Reduced Row Echelon Form: The Gauss Jordan technique results in a diagonal form; for illustration, for a 3 × 3 system: The Reduced Row Echelon Forms take this one step

Technique is to create one element - vector: Technique is to create one element with the values from one structure, and use repmat to replicate it to the preferred size. Then,

Example of Interpolation and extrapolation: The MATLAB has a function to do this, known as polyfit. The function polyfit finds the coefficients of the polynomial of the partic

FOR Loop: The for loop, or the for statement, is used whenever it is essential to repeat statement(s) in the script or function, and whenever it is known ahead of time how man

Converting between the String and Number types: The MATLAB has many functions which convert numbers to strings in which each character element is a separate digit, and vice 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

Polyhedron - graphics objects: The field polyhedron.vertices is a matrix in which each row presents (x,y,z) points. The field polyhedron.faces defines the faces: for illustrat

Use polyval to evaluate the derivative at xder. This will be the % slope of the tangent line, "a" (general form of a line: y = ax + b). % 4. Calculate the intercept, b, of t

For Loops which do not use an iterator Variable in the action: In all the illustrations that we seen so far, the value of the loop variable has been used in same way in the ac

Calling of Function polyval: The curve does not appear very smooth on this plot, but that is as there are only five points in the x vector. To estimate the temperature