1. Go to this page and download the library: Download devtronic/morpheus library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
devtronic / morpheus example snippets
use Devtronic\Morpheus\Matrix;
$matrix = new Matrix([
[1, 2, 3],
[4, 5, 6]
]);
// or
$matrix = new Matrix();
$matrix->setData([
[1, 2, 3],
[4, 5, 6]
]);
use Devtronic\Morpheus\Matrix;
$matrixA = new Matrix([
[1, 2, 3],
]);
$matrixB = new Matrix([
[4, 5, 6],
]);
$matrixA->add($matrixB);
print_r($matrixA->getData());
// [ [5, 7, 9] ]
use Devtronic\Morpheus\Matrix;
$matrixA = new Matrix([
[4, 5, 6],
]);
$matrixB = new Matrix([
[1, 2, 3],
]);
$matrixA->subtract($matrixB);
print_r($matrixA->getData());
// [ [3, 3, 3] ]