Example of functions which complete a task, MATLAB in Statistics

Example of Functions which complete a task:

For illustration, the function below just prints the number arguments passed to it in a sentence format:

1481_Example of Functions which complete a task.png

As this function isn't computing anything, there are not any output arguments in the function header, and no =. An illustration of a call to the function is as shown below:

>> printem(3.3, 2)

The first number is 3.3 and the second is 2.0

Note that as the function is not returning any of the value, it cannot be called from an assignment statement. Any try to do this would answer in an error, for illustration,

>> x = printem(3, 5) % Error!!

??? Error using ==> printem

Too many output arguments.

We can hence, think of the call to the function which does not return values as a statement by itself, in which the function call cannot be imbedded in the other statement like an assignment statement or an output statement.

Posted Date: 10/19/2012 8:03:11 AM | Location : United States







Related Discussions:- Example of functions which complete a task, Assignment Help, Ask Question on Example of functions which complete a task, Get Answer, Expert's Help, Example of functions which complete a task Discussions

Write discussion on Example of functions which complete a task
Your posts are moderated
Related Questions
Index vector: The index vector is then used as the indices for original vector. To get grades vector in ascending order, the indices used would be grades (2), grades (5), and

Example of Core objects: The one core graphics object is a line that is also what the plot function produces. Here is an illustration of generating a line object, altering som

Location of a rectangle - graphics objects: The location of a rectangle is [x y w h], where x and y are the coordinates of the lower left point, here w is the width, and h is

Vectorizing: In most of the cases in MATLAB, loops are not essential. As MATLAB is written specifically to work with the vectors and matrices, most operations can be completed

Illustrations of Sequential search: The two illustrations of calling such function is as shown below: >> values = [85 70 100 95 80 91]; >> key = 95; >> seqsearch

Opening and Closing a File: The Files are opened with the fopen function. By the default, fopen function opens a file for reading. If the other mode is preferred, a permission

Illustration of nested for loops and the if statements: For illustration,when the file contains: 33   -11  2  4      5   9 22     5  -7  2     11    3 the outco

Execution of persistent variables: The functions can also be called from the script or from the Command Window, as shown here. For illustration, the functions are called first

Logical Built-In Functions: There are built-in functions in the MATLAB which are useful in conjunction with vectors or matrices of all logical true or false values; two of the

Statistics There are numerous statistical analyses which can be executed on data sets. In MATLAB software, the statistical functions are in the data analysis help topic known a