# Is this a bug on the zero power of matrix?

9 views (last 30 days)

Show older comments

##### 0 Comments

### Answers (2)

James Tursa
on 6 May 2015

Edited: James Tursa
on 6 May 2015

There are multiple ways of evaluating the limit of x^y when x and y both go to 0. One of them, the way you used, is to start with 0^y for positive y and then shrink y to 0. The limit in this case is 0, of course. Another way is to start with x^0 for positive x and then shrink x to 0. The limit in this case is 1. Extend these concepts to an NxN matrix and you get zeros(N) and eye(N) as the possible choices. There are arguments on both sides as to which is the "correct" or "more useful" value for computing purposes, and the advantages and disadvantages of each choice. MATLAB has chosen the latter probably for consistency with IEEE lower level functions.

E.g., one consequence of this is that (sparse matrix)^0 is no longer sparse since all of those 0 elements become 1.

Two of the gazillion links on this:

##### 0 Comments

### See Also

### Categories

### Products

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!