Colon operator, MATLAB Programming

The Colon Operator:

If the values in the vector are regularly spaced, the colon operator is used to iterate through these values. For illustration, 1:5 results in all the integers from 1 to 5:

>> vec = 1:5

vec =

1  2  3  4  5

Note that in this situation, the brackets [ ] are not essential to define the vector.

With the colon operator, a step value can also be identified with the other colon, in the form (first: step: last). For illustration, to generate a vector with all the integers from 1 to 9 in steps of 2:

>> nv = 1:2:9

nv =

1  3  5  7  9

 

Posted Date: 10/18/2012 4:14:03 AM | Location : United States







Related Discussions:- Colon operator, Assignment Help, Ask Question on Colon operator, Get Answer, Expert's Help, Colon operator Discussions

Write discussion on Colon operator
Your posts are moderated
Related Questions
#question.i want to know the number of pixels related to the actual phase value and want to separate the zero phase valued pixels from the image..


Savannah says that the least common multiple of 4 and 6 is 24. Is she right or what is her mistake?

Water flow varies with water pressure. Two studies were made and two equations were developed: Parabolic fit:  F = 59.60180 + 3.77965 P - 0.01536 P 2       P

Write a function that solves a system of linear equations or calculates the inverse of a matrix by Gauss-Jordan elimination. Your function should accept a matrix as an argument and

Format command: The format command can be used to control the spacing between the MATLAB command or expression and the outcome; it can be either compact or loose. >> format

Your functions will allow you to create the following graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and t

The occurrence of bushfires in the Port Stephens area may be modelled by a Poisson process. The average occurrences of bushfires n is assumed to be either 15 (event A 1 ), 20 (even

The mass of the spring-mass-damper system shown below was initially displaced by 1 meter to the right and then released. The subsequent acceleration of the mass was measured using