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

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

Illustration of Mode When there is more than one value with similar (highest) frequency, then the smaller value is mode. In the case below, as 3 and 8 appear twice in the vecto

Operation on file: We concentrate first on the fgetl function that reads strings from the file one line at a time. The fgetl functions afford more control over how the data is

Illustration of Indexing into vectors of structures: For illustration, the function to print the information from packages has been modified therefore in addition to the vecto

Data structure layers: There are many layers in this variable. For illustration,  cyls is the whole data structure, that is a vector of structs  cyls(1) is a separate

Example of Function stubs: The three functions have not so far been written, though, therefore the function stubs are put in place so that the script can be executed and teste

Logical errors: The Logical errors are more complicated to locate, as they do not result in any error message. The logical error is a mistake in reasoning by the programmer, b

Run-time or execution-time error: The Run-time, or execution-time, errors are found whenever a script or function is executing. With most of the languages, an illustration of

Introduction and Purpose In the lectures and tutorials you have been introduced to a number of probability distributions. You have also learned that modelling any system (such