Efficient method, MATLAB Programming

The Efficient Method:

Though, in MATLAB, there is another built-in function which specifically produces random integers, i.e. randint. Calling the function with randint (1,1,n) produces one random integer in the range from 0 to N - 1. The first two arguments basically specify that one random integer will be returned; the third argument gives the range of that random integer. For illustration,

>> randint(1,1,4)

produces a random integer in the range from 0 to 3. Note: Even though it creates random integers, the type is really the default type double.

The range can also be passed to randint function. For illustration, the below indicates a random integer in the range from 1 to 20:

>> randint(1,1,[1,20])

 

Posted Date: 10/18/2012 4:06:02 AM | Location : United States







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

Write discussion on Efficient method
Your posts are moderated
Related Questions
construct a matlab program to calculate and to plot the electron and hole concentration as a function of the Fermi-level in an energy gab of Si at a Given temperature and the carri

Barrier Option pricing in Matlab using MC simulation or finite difference methods

#question how to solve radicals exponents..

Variable names: Variable names are an example of the identifier names. The rules for identifier names are as shown below: (A)The name should begin with a letter of the alph


Illustration of switch statement: Here are the two illustrations of calling this function: >> quiz = 22; >> lg = switchletgrade(quiz) lg = X >> quiz = 9; >>

a. Develop and submit the simulation described above. b. Provide a screen shot of the outputs of the DispConfig and MCResults functions. c. Notes: • Include the PPConfig f

The Colon Operator: If the values in the vector are regularly spaced, the colon operator is used to iterate through these values. For illustration, 1:5 results in all the inte

Illustration of Input function: For illustration, >> rad = input('Enter the radius: ') Enter the radius: 5 rad = 5 If character or string input is preferred, 's' s

1.      Write a MATLAB program to generate and plot the signal                                     x1(n) = [3 2 -2 0 7],  n = 0,1,2,3,4. 2.      Write a MATLAB program to gen