# MatScale

Scales all elements of a matrix by a given number.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatScale(Mat mat,PetscScalar a)

Collective on Mat

### Input Parameters

| mat | - the matrix to be scaled
| a | - the scaling value

### Output Parameter

mat -the scaled matrix

### See Also

MatDiagonalScale()

Level:intermediate
Location:src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages