Function call - modular program, MATLAB in Engineering

Function call:

In the function call, not any arguments are passed so there are no input arguments in the function header. The function returns an output argument, therefore that is stored in one variable.

calcarea function:

function call: area = calcarea(radius);

function header: function area = calcarea(rad)

In the function call, only one argument is passed in the parentheses, therefore there is one input argument in the function header. The function returns an output argument and hence that is stored in one variable.

printarea function:

function call: printarea(radius,area)

function header: function printarea(rad,area)

In the function call, there are two arguments passed, hence there are two input arguments in the function header. The function does not return anything, therefore the call to the function is a statement by itself; it is not in an assignment or output statement.

Obviously, the readradius function must actually error-check the user's input.


Posted Date: 10/19/2012 8:18:24 AM | Location : United States

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

Write discussion on Function call - modular program
Your posts are moderated
Related Questions
Data structures: The Data structures are variables which store more than one value. In order to made sense to store more than one value in a variable, the values must in some

Illustration of Variable scope: Running this function does not add any of variables to the workspace, as elaborated: >> clear >> who >> disp(mysum([5 9 1]))

Individual structure variable: The individual structure variable for one software package may look like this: The name of the structure variable is a package; it has f

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

readlenwid function: function call: [length, width] = readlenwid; function header: function [l,w] = readlenwid In the function call, not any argument is passed; henc

Technique to create Nested structures: This technique is the most proficient. Though, the other technique is to build the nested structure one field at a time. As this is a ne

Illustration of gauss-jordan elimination: An illustration of interchanging rows would be r1 ¬→ r3, that would results: Now, beginning with this matrix, an illustration of sc

Illustration of Subfunctions: This is an illustration of running this program: >> rectarea Please enter the length: 6 Please enter the width: 3 For a rectan

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

Function cellplot - Cell array: The function cellplot place a graphical display of the cell array in a figure Window; though, it is a high-level view and fundamentally just di