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
Use of While loop: Here is an illustration of calling the function, passing 5000 for the value of the input argument high. >> factgthigh(5000) ans = 5040 The itera

Evaluating a string: The function eval is used to compute a string as a function. For illustration, below is the string 'plot(x)'is interpreted to be a call to plot the functi

Displaying expressions: The good-looking function will show such expressions by using exponents; for illustration, >> b = sym('x^2') b = x^2 >> pretty(b)

Illustration of Sorting strings: To sort on the rows rather than second dimension should be specified. >> sort(words,2) ans = Hello Hdowy Hi Gbdeo

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

A matlab function to calculate filter order

Replacing a string - function strrep: The function strrep finds all the occurrences of a substring within the string, and substitutes them with a new substring. The order of a

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

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

i want to run 4 instances of my matlab code on 4 processor cores. im executing the job from head node. i created a parallel job and assigned number of workers. but i don''t get bac