www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/InverseMatrixExample.m

    %% Inverse Matrix
% Compute the inverse of a 3-by-3 matrix.
X = [1 0 2; -1 5 0; 0 3 -9]

%%
Y = inv(X)

%%
% Check the results. Ideally, |Y*X| produces the identity matrix. Since
% |inv| performs the matrix inversion using floating-point computations, in
% practice |Y*X| is close to, but not exactly equal to, the identity matrix
% |eye(size(X))|.
Y*X