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

Polynomials: Simple curves are polynomials of various degrees, or orders. The degree is the integer of the highest exponent in the expression. The illustrations are as follows

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

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 Input in a for loop: In this illustration, the loop variable iv iterates through the values 1 through 3, therefore the action is repeated three times. The acti

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

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

Example of customizing plots: As the other illustration of customizing plots, the pieces of a pie chart can be "exploded" from the rest. In this situation, the two vectors are

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

Function Stubs: The other common debugging method, which is used when there is a script main program which calls many functions, is to use the function stubs. A function stub