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
Write a script to determine the volume of a pyramid, which is 1/3 * base * height, where the base is length * width. On time the user to enter values for the length, width, and th


Illustration of Built-in functions and help: To find out what a specific function does and how to call it, type help and then the name of function. Illustration: >> help si

if i have a 3x2 double.. how can i run a for loop for this matrix so tht it can subtracted values of he adjacent neighbors?

Temperature readings were done every hour (starting at 1 P.M., but the end time could vary) and stored in a vector called readings. Write a function called halffit that receives th

An FIR filter has coefficients b = [ 1.0000   -0.6387    1.0214    0.8210   -0.7470    1.0920 ] (a) Find H(z) for the filter and plot its frequency response (magnitude and phase

Write a MATLAB program to find the undamped natural frequencies and modes of an electric car treating it as a four degree of freedom system. Determine the undamped natural frequenc

Referring to and Modifying Elements: The particular element in a vector is accessed by using the name of the vector variable and the element number (or subscript, or index) in

Write a MATLAB program that calculates the arithmetic mean, and the root-mean-square average for a given set of values. The output should be formatted as follows: Y

A filter described by the equation:    y(n) = x(n) + x(n-1) + 0.9 y(n-1) - 0.81 y(n-2) (a) Find the transfer function H(z) for the filter and find the poles and zeros of the fil