Programming concept, MATLAB Programming

The Programming Concept:

In most of the programming languages, random function returns a real number; therefore the real number would then have to be rounded to produce a random integer. For illustration,

>> round(rand*10)

would produce one random integer in the range from 0 to 10 (rand*10 would generate a random real in the range from 0 to 10; from which rounding will return an integer). Or, to produce a random integer in a range:

>> low = 2;

>> high = 6;

>> round(rand*(high-low)+low)

This would produce a random integer in the range from 2 to 6.

 

Posted Date: 10/18/2012 4:05:30 AM | Location : United States







Related Discussions:- Programming concept, Assignment Help, Ask Question on Programming concept, Get Answer, Expert's Help, Programming concept Discussions

Write discussion on Programming concept
Your posts are moderated
Related Questions
Output Statements: disp and fprintf: The Output statements display strings and the answers of expressions and can permit for formatting or customizing how they are exhibited.

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

You">http://www.cs.utsa.edu/~cs1173/labs/laboratory2.html You can go to this link and it should come up I need this by tommorow at 10:00 I just need the published part where you r

Objectives In the following exercises, students are required ?rstly to implement code to determine the frequency components present in a signal, and then to extract a desired si

Obtain the input - Algorithms: From where does the input come? The two possible choices would be from an external file on a disk, or from the user, who enters the number by ty

coding of sep protocol

Write a function called threshold2 (in a file called 'threshold2.m'). The function takes an arbitrary number of input variables. The first input variable, t, is required and is the

Write a matlab function that calls eig and generates an estimate of the smallest three eigenvalues and associated eigenfunctions of the negative Laplacian operator on ?. (Hint: thi

I need assistance in learning on how to do simulation of system described with an algebraic equations.

i have a problem in doing my project which detects image forgery detection using resampling technique any one please help in writing my program