, , ( , ), , . , . MATLAB , . , , sparse:
>> A=[0 1 0 0; 0 0 1 0; 0 0 0 1; -4 0 0 0]
A =
0 1 0 0
0 0 1 0
0 0 0 1
-4 0 0 0
>> S=sparse (A)
S =
(4, 1) -4
(1, 2) 1
(2, 3) 1
(3, 4) 1
>> whos S
Name Size Bytes Class Attributes
S 4x4 104 double sparse
>> whos A
Name Size Bytes Class Attributes
A 4x4 108 double
, sparse , S sparse array, , A.
full:
>> full (S)
ans =
0 1 0 0
0 0 1 0
0 0 0 1
-4 0 0 0
, MATLAB .
: .
.
, . ( .)
, , , , , .
:
,
, , .
, :
,
, ,
, , - .
,
, , .
, , .
|
|
,
,
, .
.
, , , , , ; , , , , ,
,
,
, .. , . .
, , - .
: 1) , 2) .
, .
, . .