Program of built-in factorial function, MATLAB in Mathematics

Program of built-in factorial function:

Calling this function yields similar result as the built-in factorial function:

>> fact(5)

ans =

  120

>> factorial(5)

ans =

  120

The recursive factorial function is a very common illustration of a recursive function. It is somewhat of a lame illustration, though, as recursion is not essential to find a factorial; a for loop can be just used as well in the programming (or, obviously, the built-in function in MATLAB).

 

Posted Date: 10/22/2012 1:32:35 AM | Location : United States







Related Discussions:- Program of built-in factorial function, Assignment Help, Ask Question on Program of built-in factorial function, Get Answer, Expert's Help, Program of built-in factorial function Discussions

Write discussion on Program of built-in factorial function
Your posts are moderated
Related Questions
Use of string variables: The Characters involve letters of the alphabet, punctuation marks, digits, white space, and control characters. The Control characters are characters

Built in recursive function in MATLAB: We have seen that the built-in function in MATLAB to compute factorials, termed as the factorial and we know how to implement the iterat

Function isreal - complex numbers: The function isreal returns 1 for logical true when there is no imaginary part of the argument, or 0 for false when the argument does have a

Applications of Customized Strings: Labels, Prompts, Arguments to Functions: The one of very useful application of this is to involve numbers in strings that are used to plot

Functions to create special matrices: The MATLAB also has various functions which create special matrices. For illustration, the zeros function generates a matrix of all zeros

Use of logical vector: Determine how many elements in the vector vec were greater than 5, the sum function can be used on the resulting vector isg: >> sum(isg) ans =

Strcat function - Concatenation : The strcat function, though, will eliminate the trailing blanks from strings before concatenating. Note that in these illustrations, the trail

Illustration of Minimum and Maximum Value Both of these functions also return the index of the minimum or maximum value; when there is more than one occurrence, it returns the

Give the formula for a rational function that has a hole at x=7 & vertical asmptote at x=-3/2

Standard Deviation The standard deviation is the square root of variance: The built-in function in a MATLAB for the standard deviation is known as std; the standard dev