Graphics Programs Reference
In-Depth Information
>>b=[123]
%Rowvector
b=
1
2
3
>>b=[1;2;3]
%Columnvector
b=
1
2
3
>>b=[123]'
%Transposeofrowvector
b=
1
2
3
The single quote ( ' ) is the transpose operator in MATLAB; thus b' is the transpose
of b .
The elements of amatrix,such as
A 11 A 12 A 13
A 21 A 22 A 23
A 31 A 32 A 33
A
=
can be accessedwith the statement A(i,j) , where i and j are the row and column
numbers, respectively. A section of an array can beextractedbythe use of colon
notation. Here is an illustration:
>>A=[816;357;492]
A=
8
1
6
3
5
7
4
9
2
>> A(2,3)
% Element in row 2, column 3
ans =
7
>> A(:,2)
% Second column
Search WWH ::




Custom Search