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
Sound Files: The sound signal is an illustration of a continuous signal which is sampled to result in a discrete signal. In this situation, sound waves traveling through the a

Algorithm for the function explaine: The algorithm for the function explaine is as shown:  Print a description of e, the exp function, and how to find the approximate va

Function rmfield - structure: The function rmfield eliminates a field from the structure. It returns a new structure with field eliminated, but does not modify the original st

Forward substitution: The Forward substitution (done methodically by first getting a 0 in the a 21 place, and then a 31 , and lastly a 32 ): For the Gauss technique,

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

Subfunctions: Though, it is possible to have more than one function in a given M-file. For illustration, if one function calls the other, the first function would be the prima

Preallocating a Vector: There are necessarily two programming techniques that can be used to simulate the cumsum function. One technique is to begin with an empty vector and c

Passing arguments to functions: In all these functions examples faraway, at least one of the arguments was passed in the function call to be the value(s) of the equivalent inp

Illustration of if - else statement: The one application of an if-else statement is to check for errors in the inputs to a script. For illustration, a former script prompted t

Finding products by for loop: an illustration, when 5 is passed to be the value of the input argument n, the function will compute and return 1 + 2 + 3 + 4 + 5, or 15: >> s