Public
Edited
Nov 28, 2022
Insert cell
Insert cell
Insert cell
Insert cell
strengths = {
// Define the matrix for or basic example:
let M = math.matrix([
[0, 2, 1],
[0, 0, 1],
[1, 1, 0]
]);
// Initialize a starting vector of all ones
let step = math.ones(3);
// Run a loop
for (let i = 0; i < 100; i++) {
step = math.multiply(M, step); // Multiply x => Ax
step = math.divide(step, math.norm(step)); // Normalize
}
return step.toArray();
}
Insert cell
Insert cell
math = require("mathjs")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more