Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
MatrixFunction
  • See Also
    • MatrixExp
    • MatrixLog
    • MatrixPower
    • Inverse
    • JordanDecomposition
    • Eigensystem
    • SchurDecomposition
  • Related Guides
    • Matrix Operations
    • Matrix Decompositions
    • Symbolic Vectors, Matrices and Arrays
  • Tech Notes
    • Basic Matrix Operations
    • Vectors and Matrices
    • See Also
      • MatrixExp
      • MatrixLog
      • MatrixPower
      • Inverse
      • JordanDecomposition
      • Eigensystem
      • SchurDecomposition
    • Related Guides
      • Matrix Operations
      • Matrix Decompositions
      • Symbolic Vectors, Matrices and Arrays
    • Tech Notes
      • Basic Matrix Operations
      • Vectors and Matrices

MatrixFunction[f,m]

gives the matrix generated by the scalar function f at the matrix argument m.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Special Matrices  
Options  
Method  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Tech Notes
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • MatrixExp
    • MatrixLog
    • MatrixPower
    • Inverse
    • JordanDecomposition
    • Eigensystem
    • SchurDecomposition
  • Related Guides
    • Matrix Operations
    • Matrix Decompositions
    • Symbolic Vectors, Matrices and Arrays
  • Tech Notes
    • Basic Matrix Operations
    • Vectors and Matrices
    • See Also
      • MatrixExp
      • MatrixLog
      • MatrixPower
      • Inverse
      • JordanDecomposition
      • Eigensystem
      • SchurDecomposition
    • Related Guides
      • Matrix Operations
      • Matrix Decompositions
      • Symbolic Vectors, Matrices and Arrays
    • Tech Notes
      • Basic Matrix Operations
      • Vectors and Matrices

MatrixFunction

MatrixFunction[f,m]

gives the matrix generated by the scalar function f at the matrix argument m.

Details and Options

  • A matrix function transforms a matrix to another matrix. For convergent power series, MatrixFunction[f,m] effectively evaluates the power series for the function f with ordinary powers replaced by matrix powers. »
  • The function f should be a unary differentiable or symbolic function.
  • MatrixFunction works only on square matrices. It applies the Schur–Parlett method for inexact matrices and Jordan decomposition for exact or symbolic matrices.
  • MatrixFunction can be used on SparseArray objects and structured arrays.
  • A Method option can be given, with possible explicit settings:
  • "Jordan"Jordan decomposition
    "Schur"Schur decomposition with block Parlett recursion
  • The "Schur" method can be specified with method options mopts by Method->{"Schur",mopts}. The following method options can be given:
  • "Balanced"Falsewhether to balance the input matrix before doing the Schur decomposition
    "BlockSeparationDelta"Automaticmaximum separation between adjacent eigenvalues in a single Parlett block

Examples

open all close all

Basic Examples  (3)

Compute the square root of a symbolic matrix:

Verify that it is, indeed, a square root:

Note that this is different from simply computing the square root of each entry:

Compute the logarithm of a 3×3 matrix m:

Verify that the exponential of the result is the original matrix:

Compute a matrix polynomial, specifying the polynomial as a pure function:

Scope  (11)

Basic Uses  (7)

Compute the matrix sine and cosine of a machine-precision matrix:

Test the matrix identity :

Compute the matrix sine for a complex matrix:

Compute the square root of an exact matrix:

Use 20-digit-precision arithmetic to compute the matrix function of a logarithm of a polynomial:

Compute the matrix sine of a symbolic diagonal matrix:

Compute the matrix tangent of a symbolic non-diagonal matrix:

Compute a matrix function with a symbolic scalar function:

Use a symbolic matrix with a symbolic scalar function:

Applying a function to a machine-precision matrix is efficient:

Special Matrices  (4)

Computing a matrix function with a sparse matrix generally produces a normal matrix:

Compute a matrix polynomial of a structured array:

Applying a matrix function to an identity matrix only changes the value of the diagonal elements:

More generally, a function of any diagonal matrix is the function applied to its diagonal elements:

Compute the square of HilbertMatrix to 20-digit precision:

Options  (4)

Method  (4)

The method "Jordan" can work with exact and inexact matrices:

The method "Schur" works only with inexact (machine- and arbitrary-precision) matrices:

If many eigenvalues are very close, they are put in a diagonal-block submatrix, which may become large; computations are then more expensive and convergence may be slow:

A smaller value for "BlockSeparationDelta" reduces the diagonal block size and also speeds convergence:

But the result may be much less accurate:

When an input matrix is poorly balanced (containing terms of very different magnitudes), balancing may improve the result:

Applications  (5)

Find the second inverse matrix power applied to a particular vector:

This is a more efficient way of computing :

Show that a matrix is a root of its characteristic polynomial:

The solution of , , for a scalar symbol is given with:

If is a matrix, the solution can be computed using matrix functions in the scalar solution:

Find the matrix that satisfies :

Confirm the formula for a Jordan matrix consisting of a single chain for the following matrix :

Properties & Relations  (11)

Using the function 1& returns an identity matrix:

Using the function 1/#& is the same as using Inverse:

Using a function that is a power is equivalent to using MatrixPower:

MatrixFunction[Exp,m] is essentially equivalent to MatrixExp[m]:

MatrixFunction effectively uses the power series, with Power replaced by MatrixPower:

Just as , MatrixExp[MatrixFunction[Log,m]] equals m:

If m is diagonal, MatrixFunction[f,m] merely applies f to each element of the diagonal of m:

If m is upper triangular, MatrixFunction[f,m] is also upper triangular:

The analogous statement holds for lower-triangular matrices:

If is diagonalizable with and the eigenvectors are well conditioned, then :

can be computed from the JordanDecomposition as v.f(j).TemplateBox[{v}, Inverse]:

Moreover, is zero except in upper-triangular blocks delineated by s in the superdiagonal:

A matrix is a root of its characteristic polynomial:

Possible Issues  (4)

The scalar function can have symbolic derivatives for exact or symbolic matrices:

Compare with this example:

MatrixFunction does not work with non-differentiable functions such as Abs:

It will return a matrix function for an exact input matrix, but the result is meaningless because Abs does not have a first or second derivative:

MatrixFunction does not return a result when the scalar function or any of its initial derivatives are not defined at matrix eigenvalues:

The scalar function f has poles (singularities) at 1, 2, and 3:

If a scalar function is not analytic and a matrix eigenvalue is close to a function pole, the resulting matrix is usually incorrect:

Neat Examples  (1)

See Also

MatrixExp  MatrixLog  MatrixPower  Inverse  JordanDecomposition  Eigensystem  SchurDecomposition

Function Repository: MatrixPolynomial  NEigenvalueSumGradient

Tech Notes

    ▪
  • Basic Matrix Operations
  • ▪
  • Vectors and Matrices

Related Guides

    ▪
  • Matrix Operations
  • ▪
  • Matrix Decompositions
  • ▪
  • Symbolic Vectors, Matrices and Arrays

History

Introduced in 2012 (9.0) | Updated in 2014 (10.0)

Wolfram Research (2012), MatrixFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixFunction.html (updated 2014).

Text

Wolfram Research (2012), MatrixFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixFunction.html (updated 2014).

CMS

Wolfram Language. 2012. "MatrixFunction." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/MatrixFunction.html.

APA

Wolfram Language. (2012). MatrixFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MatrixFunction.html

BibTeX

@misc{reference.wolfram_2025_matrixfunction, author="Wolfram Research", title="{MatrixFunction}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MatrixFunction.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_matrixfunction, organization={Wolfram Research}, title={MatrixFunction}, year={2014}, url={https://reference.wolfram.com/language/ref/MatrixFunction.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English