| Symbolic Math Toolbox™ | ![]() |
R = inv(A)
R = inv(A) returns inverse of the symbolic matrix A.
The statements
A = sym([2,-1,0;-1,2,-1;0,-1,2]); inv(A)
return
[ 3/4, 1/2, 1/4] [ 1/2, 1, 1/2] [ 1/4, 1/2, 3/4]
The statements
syms a b c d A = [a b; c d] inv(A)
return
[ d/(a*d-b*c), -b/(a*d-b*c)] [ -c/(a*d-b*c), a/(a*d-b*c)]
Suppose you have created the following M-file.
%% Generate a symbolic N-by-N Hilbert matrix.
function A = genhilb(N)
syms t;
for i = 1:N
for j = 1:N
A(i,j) = 1/(i + j - t);
end
endThen, the following statement
inv(genhilb(2))
returns
[ -(-3+t)^2*(-2+t), (-3+t)*(-2+t)*(-4+t)] [(-3+t)*(-2+t)*(-4+t), -(-3+t)^2*(-4+t)]
the symbolic inverse of the 2-by-2 Hilbert matrix.
![]() | int8, int16, int32, int64 | iztrans | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |