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
Example of Nested functions: For illustration, the function below computes and returns the volume of a cube. Three arguments are then passed to it, for the width and length of

Illustration of reading from files: For illustration, suppose that there is a data file 'subjexp.dat' that has on each line a number followed by thecharacter code. The type fu

Graphics objects: The objects involve graphics primitives like lines and text, and also the axes used to orient the objects. These objects are organized hierarchically, and the

Mode The mode of a data set is the value which appears most often. The built-in function in a MATLAB for this is known as the mode. >> x = [9 10 10 9 8 7 3 10 9 8 5 10];

Nested Functions: We have seen that the loops can be nested, that means that one inside of the other, functions can be nested. The terminology for nested functions is that an

Reading from Files: There are many lower level functions which read from files. The function fscanf reads the formatted data into a matrix, by using conversion formats like %s

WHILE Loops: The while statement is used as a conditional loop in MATLAB; it is used to repeat an action whenever ahead of the time it is not known how many times the action w

Types of errors: There are some various kinds of errors which can occur in a program, that fall into the categories of run-time errors, syntax errors, and logical errors. T

Illustration of Customizing plots: Illustration, the bar and barh functions by the default place a width of 0.8 between bars. Whenever called as bar(x,y), the width of 0.8 is

Sequential Search: A sequential search is completed by looping through the vector element-by-element starting from the beginning, looking for the key. Usually the index of the