pageinv
Inverse of each page of a 3-D array.
Category: Mathematics > Linear Algebra
Syntax
Y = pageinv(X)
Returns an array of the same size whose pages are the inverses of the square pages of X.
Description
pageinv is the batched form of inv. As with inv, solving systems with pagemldivide is better numerically than multiplying by an inverse when only the solution is needed.
Input arguments
X- Array of size
n-by-n-by-p.
Output arguments
Y- Array with
Y(:,:,k) = inv(X(:,:,k)).
Example
Inverting two pages
A = cat(3, [2 0; 0 4], [1 0; 0 5]);
B = pageinv(A);
B(:,:,1)
B(:,:,2)
Output
ans = 2×2
0.5000 0
0 0.2500
ans = 2×2
1.0000 0
0 0.2000