/// Add `$matrices`
/// @group misc
/// @param {Arglist} $matrices - matrices
/// @return {Matrix}
/// @require {function} rows
/// @require {function} columns
/// @require {function} get-entry
/// @require {function} set-entry
@function add-matrices($matrices...) {
  $matrix: nth($matrices, 1);
  $rows: rows($matrix);
  $columns: columns($matrix);

  @each $m in $matrices {
    @if $columns != columns($m) or $rows != rows($m) {
      @warn "All matrices do not have same dimensions.";
      @return false;
    }
  }

  @for $i from 1 through $rows {
    @for $j from 1 through $columns {
      $value: null;
      @each $m in $matrices {
        $entry: get-entry($m, ($i $j));
        $value: if($value == null, $entry, $value + $entry);
      }
      $matrix: set-entry($matrix, ($i $j), $value);
    }
  }
  @return $matrix;
}
