Graphics Reference
In-Depth Information
There are different ways of defining a vector variable without explicitly bracketing all its elements separated by
commas or blank spaces. They are presented in the following table:
variable = [a: b]
Defines the vector whose first and last elements are a and b, respectively, and the
intermediate elements differ in one unit
variable = [a: s:b]
Defines the vector whose first and last elements are a and b, and the intermediate
elements differ in the amount specified by the increase in s
variable = linespace [a, b, n]
Defines the vector whose first and last elements are a and b, and has in total n
evenly spaced elements
variable = logspace [a, b, n]
It defines the vector whose first and last elements are specified and has in total n
evenly spaced elements together on a logarithmic scale
Below are some examples:
>> vector2 = [5:5:25]
Vector2 =
5 10 15 20 25
We have retrieved the numbers between 5 and 25 separated by 5 units.
>> vector3 = [10:30]
Vector3 =
Columns 1 through 13
10 11 12 13 14 15 16 17 18 19 20 21 22
Columns 14 through 21
23 24 25 26 27 28 29 30
We have obtained the numbers between 10 and 30 including the endpoints.
>> t:Microsoft.WindowsMobile.DirectX.Vector4 = linspace (10,30,6)
t:Microsoft.WindowsMobile.DirectX.Vector4 =
10 14 18 22 26 30
Search WWH ::




Custom Search