Help function, MATLAB in Statistics

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 [ ]. And hence, somewhere in the body of the function, the values have to be assigned to both. As the function is returning two values, it is significant to capture and store them in separate variables when the function is called, merely as both the number of rows and the number of columns would be captured from the size function. In this situation, the first value returned, that is the area of the circle, is stored in the variable a and the second value returned is stored in the variable c.

>> [a c] = areacirc(4)

a =

   50.2655

c =

   25.1327

 

If this is not completed, only the first value returned is maintained; in this situation, the area will be:

 

>> disp(areacirc(4))

   50.2655

 

Note that in capturing the values the order matter. In this situation, the function returns at first the area & then next the circumference of the circle. The order in which the values are assigned to the output arguments within the function, though, does not matter.

The help function represents the comment listed under the function header:

>> help areacirc

  This function computes the area and

  the circumference of a circle

 

Posted Date: 10/19/2012 6:23:51 AM | Location : United States







Related Discussions:- Help function, Assignment Help, Ask Question on Help function, Get Answer, Expert's Help, Help function Discussions

Write discussion on Help function
Your posts are moderated
Related Questions
Functions which complete a task without returning Values: Most of the functions do not compute values, but instead of accomplish a task like printing formatted output. As thes

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

Use of function polyval: The better the curve fit, the more exact these interpolated and extrapolated values will be. By using the subplot function, we can loop to display the

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

Editor/Debugger: The MATLAB has numerous useful functions for debugging, and debugging can also be completed through its editor, which is known as the Editor/Debugger. Typi

Curve Fitting: The data is fundamentally either discrete or continuous. In most of the applications, data is sampled, for illustration, The temperature recorded every ho

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

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

Determine sequence weights for the sequences ACTA, ACTT, CGTT, and AGAT in problem 1 by using Thompson, Higgins, and Gibson method a) compute pairwise distances between sequences

Example of Functions which return values: Calling this function prints the circumference, since there is no way to store the value, hence, it can be used in following computat