Graphics Reference
In-Depth Information
We have obtained 6 numbers between 10 and 30 inclusive, equally spaced.
>> vector5 = logspace (10,30,6)
vector5 =
1. 0e + 030 *
0.0000 0.0000 0.0000 0.0000 0.0001 1.0000
We have obtained 6 numbers between antilogarithm decimal of 0 and antilogarithm decimal of 2, spaced evenly.
There is also the possibility of considering vector row and column vectors in MATLAB. A column vector is
obtained by separating its elements by semicolons, or also transposing a vector row using a single quotation mark
located at the end of its definition.
>> a=[10;20;30;40]
a =
10
20
30
40
>> a=(10:14);b=a'
b =
10
11
12
13
14
>> c=(a')'
c =
10 11 12 13 14
You can also select an element of a vector or a subset of elements. The following table shows the rules:
x (n)
Returns the nth element of the vector x
x(a:b)
Returns the elements of the vector x between the a-th and the b-th, both inclusive
x(a:p:b)
Returns the elements of the vector x located between the a-th and the b-th, both inclusive, but separated
by p units (a > b).
x(b:-p:a)
Returns the elements of the vector x located between the b-th and a-th, both inclusive, but separated by
p units and starting with the b-th (b > a)
Search WWH ::




Custom Search