Help function, MATLAB in Statistics

Assignment Help:

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

 


Related Discussions:- Help function

Curve fitting, Curve Fitting: The data is fundamentally either discret...

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

Persistent variables, Persistent Variables: Generally, whenever a func...

Persistent Variables: Generally, whenever a function stops executing, then the local variables from that function are cleared. That means that each and every time a function i

Create a custom chi-square function in matlab, Introduction and Purpose ...

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

Illustration of input in a for loop, Illustration of Input in a for loop: ...

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

Example of functions which return values, Example of Functions which return...

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

Reading from files, Reading from Files: There are many lower level fun...

Reading from Files: There are many lower level functions which read from files. The function fscanf reads the formatted data into a matrix, by using conversion formats like %s

Logical built-in functions, Logical Built-In Functions: There are buil...

Logical Built-In Functions: There are built-in functions in the MATLAB which are useful in conjunction with vectors or matrices of all logical true or false values; two of the

Function stubs, Function Stubs: The other common debugging method, whi...

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

Illustrations of sequential search, Illustrations of Sequential search: ...

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

Example of sorting strings, Example of sorting strings: To sort a cell...

Example of sorting strings: To sort a cell array of strings, also the sort function is used. The illustration is as follows, >> engcellnames = {'Chemical','Mechanical',.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd