<?php/** * * Function code for the matrix division operation * * @copyright Copyright (c) 2013-2018 Mark Baker (https://github.com/MarkBaker/PHPComplex) * @license https://opensource.org/licenses/MIT MIT */namespaceMatrix;useMatrix\Operators\Division;/** * Divides two or more matrix numbers * * @param mixed[] $matrixValues The matrices to divide * @return Matrix */functiondivideby(...$matrixValues){if(count($matrixValues)<2){thrownew\Exception('This function requires at least 2 arguments');}$matrix=array_shift($matrixValues);if(!is_object($matrix)||!($matrixinstanceofMatrix)){$matrix=newMatrix($matrix);}$result=newDivision($matrix);foreach($matrixValuesas$matrix){$result->execute($matrix);}return$result->result();}