|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
ArrayRules
ArrayRules[SparseArray[...]]
gives the rules
specifying elements in a sparse array.
ArrayRules[list]
gives rules for SparseArray[list].
DetailsDetails
- The last element of ArrayRules[s] is always
, where def is the default value for unspecified elements in the sparse array. » - ArrayRules[list, val] takes the default value to be val. »
- ArrayRules[list] assumes a default value of 0. »
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
Get the explicit elements in a SparseArray:
| In[1]:= |
| Out[1]= |
| In[2]:= |
| Out[2]= |
These rules are sufficient to efficiently construct an identical SparseArray:
| In[3]:= |
| Out[3]= |
| In[4]:= |
| Out[4]= |
New in 5
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
