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
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

Program of passing arguments to functions: This was an illustration of a function which did not receive any input arguments nor did it return any output arguments; it easily a

Function issorted - set operations: The function issorted will return 1 for logical true when the argument is sorted in ascending order (minimum to maximum), or 0 for false wh

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

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

Graphics Properties: The MATLAB uses the Handle Graphics in all its figures. All figures consist of various objects, each of which is assigned a handle. The object handle is a

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


. Generate the following signal, x(n)=1+cos((25*pi*n)/100),0 Compute the DTFT of x[n] for w=0:0.01:2*pi Plot the Real part, imaginary part, the amplitude and phas

Simplification Functions: There are numerous functions which work with expressions, and simplify the terms. Not all the expressions can be simplified, but the simplify functio