Qurak

Linear algebra sparse arrays sparsearray data format

Tutorial 2 stappen, op volgorde uitgevoerd in één sessie. Elke stap is tegen de engine uitgevoerd en de uitvoer hieronder is wat hij opleverde.

Stap 1
sp = SparseArray[{{1, 1} -> a11, {1, 3} -> a13, {2, 1} -> a21,
	{2, 4} -> a24, {3, 2} -> a32, {3, 3} -> a33}, {3, 4}];
sp//MatrixForm
Uitvoer
MatrixForm[SparseArray[Automatic, {3, 4}, 0, {1, {{0, 2, 4, 6}, {{1}, {3}, {1}, {4}, {2}, {3}}}, {a11, a13, a21, a24, a32, a33}}]]
Stap 2
sp//InputForm
Uitvoer
InputForm[SparseArray[Automatic, {3, 4}, 0, {1, {{0, 2, 4, 6}, {{1}, {3}, {1}, {4}, {2}, {3}}}, {a11, a13, a21, a24, a32, a33}}]]

Gebruikte functies

Gerelateerde recepten

Alle recepten · Functiereferentie · Gebruik dit vanuit een MCP-client