Graphics Reference
In-Depth Information
years =
0 0 1 0
years =
0 0 0 1
years =
1
>> ismember ([1,2,3], [8,12,1,3]), A = [2,0,1];B = [4,0,2]; isequal (2A * B)
Ans =
1 0 1
Ans =
1
A.12 Vector Variables
A vector variable of n elements can be defined in MATLAB in the following ways:
V = [v1, v2, v3,..., vn]
V = [v1 v2 v3... vn]
When you apply most commands and functions of MATLAB on a vector variable the result obtained is the
application of the command or function on each element of the vector:
>> vector1 = [1,4,9,2.25,1/4]
vector1 =
1.0000 4.0000 9.0000 2.2500 0.2500
>> sqrt (vector1)
Ans =
1.0000 2.0000 3.0000 1.5000 0.5000
 
Search WWH ::




Custom Search