mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
Fixed matrix.get and matrix.set examples in readme
This commit is contained in:
parent
4d7dcfbdf3
commit
23d77ae01c
@ -412,7 +412,7 @@ math.factorial(array); // Array, [1, 2, 6, 24, 120]
|
||||
|
||||
var a = [[1, 2], [3, 4]]; // Array, [[1, 2], [3, 4]]
|
||||
var b = math.matrix([[5, 6], [1, 1]]); // Matrix, [[5, 6], [1, 1]]
|
||||
b.set(math.index(2, [1, 2]), [[7, 8]]); // Matrix, [[5, 6], [7, 8]]
|
||||
b.set(math.index(2, [1, 3]), [[7, 8]]); // Matrix, [[5, 6], [7, 8]]
|
||||
var c = math.multiply(a, b); // Matrix, [[19, 22], [43, 50]]
|
||||
var d = c.get(math.index(1, 0)); // 43
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user