
Comments:
Examples of dot power. The second or the forth power of a certain
vector can be defined either with the dot power or the dot product
operation.
Before leaving this section, the reader should note that dot power of vectors
is performed before any other operation, followed by the dot product and the
dot division. Off course, if a complex vector command involves
manipulations into brackets, these are executed before any other action.
2.1.4.3 Some Useful Vector Functions
Table 2 lists some useful function that can be used with row and column
vectors. This list is by no way exhaustive.
Basic Information Elementary Matrices and Arrays
d
d
i
i
s
s
p
p
Display array
l
l
i
i
n
n
s
s
p
p
a
a
c
c
e
e
Generate linearly spaced
vectors
d
d
i
i
s
s
p
p
l
l
a
a
y
y
Display array
l
l
o
o
g
g
s
s
p
p
a
a
c
c
e
e
Generate logarithmically
spaced vectors
i
i
s
s
e
e
m
m
p
p
t
t
y
y
True for empty vector
o
o
n
n
e
e
s
s
Create array of all ones
i
i
s
s
e
e
q
q
u
u
a
a
l
l
True if arrays are
identical
r
r
a
a
n
n
d
d
Uniformly distributed
random numbers and arrays
l
l
e
e
n
n
g
g
t
t
h
h
Length of vector
z
z
e
e
r
r
o
o
s
s
Create array of all zeros
Operations and Manipulation
c
c
u
u
m
m
p
p
r
r
o
o
d
d
Cumulative product
m
m
e
e
a
a
n
n
Average of array
c
c
u
u
m
m
s
s
u
u
m
m
Cumulative sum
m
m
e
e
d
d
i
i
a
a
n
n
Median of array
e
e
n
n
d
d
Last index
m
m
i
i
n
n
Minimum elements of array
f
f
i
i
n
n
d
d
Find indices of
nonzero elements
s
s
o
o
r
r
t
t
Sort elements in ascending
order
m
m
a
a
x
x
Maximum elements
of array
s
s
u
u
m
m
Sum of array elements
Table 2: Various functions that can be used with vectors.
Use the
h
h
e
e
l
l
p
p facilities to see how these functions can be used. The following
illustrate the use of some of these functions.
Matlab’s command:
>> clear; clc;
>> x=[ ]; isempty(x)
>> x=linspace(1, 10, 6), x=logspace(0.1, 0.5, 6); x(7)=0.1; x
>> sort(x), cumsum(x), [Max, I]=max(x), x(end)
Comentarios a estos manuales