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
Write a program in Mathlab for addition of two matrices.

Q.1: Consider the transmission of a sinusoid x(t) = cos(2f0t) through a channel a ected by multipath and Doppler. Let there be two paths, and assume the sinusoid is being sent fro


The purpose of this assignment is to use Matlab/Simulink to analyse and simulate a mathematical model of an electromechanical system. This system comprises two component subsystems

Goal: Learn how to do statistics, sorting and curve fitting in Matlab. Put all of those ".m" files in a folder called yourname_lab7, and zip the folder and submit it on the class w


using 0de 45 how can i get the anlytical and numerical solutions for an equation,,

I have a biological signal need to be shifted by 12.5 ms and then add all the shefted signals together

Create a Super Mario Brothers game in Matlab. The lines of codes do not matter. But, The requirements are: REQUIREMENTS: Modular design and implementation Algorithm docu

Make a vector of 500 random numbers from a normal distribution with mean 2 and standard deviation 5(randn). a After you generate the vector, verify that the sample mean and stan