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
Illustration of tracing a error: The one way of following the flow of function, or tracing it, is to use the echo function. The echo function, that is a toggle, will show each

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

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

Lower Level File I/O Functions: Whenever reading from data file, as long as the data in the file is "regular" the load function works-in another words, the similar type of dat

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 Mode When no value appears more often than any other, the smallest value in the vector will be the mode of the vector. >> shortx = [2 5 1 4]; >> mode(shortx

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

Example of Functions which complete a task: For illustration, the function below just prints the number arguments passed to it in a sentence format: As this function i

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

#qYou will need to examine two of the nine sections of data: one section of qualitative data (choose either Gender or Position) one section of quantitative data (choose either Intr