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
Use an expression for the far-field radiation from a plane circular piston to create a more accurate model of a column loudspeaker system - you will need to calculate individual so

Minimum Cost Pizza Problem. Using only the items given in the tables below, create a minimum cost pizza which satis?es both the nutritional requirements of Table 1 and bounds on it

Types: Each and every expression, or variable, has a type related with it. The MATLAB supports numerous types of values that are known as classes. A class is necessarily a com

This project carries 50% of your ?nal mark. Please hand in your work to the Mathematical and Physical Sciences School O?ce, no later than 4pm Monday 21st January 2013. Please ?l

Printing Vectors and Matrices: For vector, if the conversion character and newline character are in the format string, it will print in a column in spite of of whether the vec

A. Introduction The project consists of two parts. In the first part you are asked to perform some preliminary calculation and plotting, and to write the introduction for your

need help in my accounts help

Ask question #Mingdfgdfgdfgimum 100 words accepted#

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

i want matlab programming on johnson''s sequencing rule