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 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

Characters and Encoding: A character in a MATLAB is represented by using single quotes (example, 'a' or 'x'). The quotes are essential to denote a character; without them, the

The cost of sending a package by an express delivery service is $15 for the first two pounds, and $4.25 for each pound over two pounds. Write a program that computes the cost of

how do you make a program for a parachute man falling to determine his terminal velocity, having in consideration the drag force (cv^2). I have the formula to be v(i+1)=v(i)*delta(

would you please send the programing code simulation.

my project is on load frequency control using FPID tuned using GA and PSO algorithm.the system is a two area system.

Diary Files: Before doing this assignment, please read the document Notes on Matlab Assignments (available from the course web page). It describes how to record the results of your

can we use regression in bioinformatics toolbox?

cAN Can I learn Metlab .I am X Scientist in DigitalCommunication. Can U please help me.I know the programming concepts

The average speed of vehicles on a freeway is being studied. Assume that the standard deviation of vehicle speed is known to be 8 km/h. (a) Suppose observations on 120 vehicles