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
fopen function - file function: The fopen opens the file for reading. The fscanf then reads each line one double and one character, and put each pair in individual columns in

Help function: Function is computing the two values, there are two output arguments in the function header (i.e., area & circum), that are placed in the square brackets [ ]. A

Core Objects: The Core Objects in MATLAB are the very fundamental graphics primitives. The description can be found under the MATLAB Help: Under the Contents tab, click the Ha

Need of a nested loop: How would we sum each individual column, rather than getting an overall sum? Answer: The programming technique would need a nested loop in whi

Steps for input output functions - Lower level file: The steps involved are as shown below:  Open the file.  Read the file, write to the file, or append to the file.

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

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

Advanced File Input and Output: In that section, we saw how to read the values entered by user using the input as well as the output functions disp and fprintf, that shows inf

Nested for Loops: The action of a loop can be any of the valid statement(s). Whenever the action of a loop is the other loop, this is known as nested loop. As an illustrati

Illustration of Nested loops: Running the script shows the output: >> printstars ***** ***** ***** The variable rows identifies the number of rows to print, and