%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Illustration of inv and eye commands %% Some examples from book %% Problem 6, p. 107 %%%%%%%%%%%%%%%%%%%%%%%%%%% A=[.02 .02 .10;.20 .01 0;.10 .02 .01] A = 0.0200 0.0200 0.1000 0.2000 0.0100 0 0.1000 0.0200 0.0100 D=[4.5;2;1] D = 4.5000 2.0000 1.0000 help eye EYE Identity matrix. EYE(N) is the N-by-N identity matrix. EYE(M,N) or EYE([M,N]) is an M-by-N matrix with 1's on the diagonal and zeros elsewhere. EYE(SIZE(A)) is the same size as A. EYE with no arguments is the scalar 1. EYE(M,N,CLASSNAME) or EYE([M,N],CLASSNAME) is an M-by-N matrix with 1's of class CLASSNAME on the diagonal and zeros elsewhere. Note: The size inputs M and N should be nonnegative integers. Negative integers are treated as 0. Example: x = eye(2,3,'int8'); See also SPEYE, ONES, ZEROS, RAND, RANDN. Overloaded methods: distributed/eye codistributor2dbc/eye codistributor1d/eye codistributed/eye I=eye(3) I = 1 0 0 0 1 0 0 0 1 I-A ans = 0.9800 -0.0200 -0.1000 -0.2000 0.9900 0 -0.1000 -0.0200 0.9900 help inv INV Matrix inverse. INV(X) is the inverse of the square matrix X. A warning message is printed if X is badly scaled or nearly singular. See also SLASH, PINV, COND, CONDEST, LSQNONNEG, LSCOV. Overloaded methods: lti/inv idmodel/inv uss/inv umat/inv ufrd/inv ndlft/inv atom/inv Reference page in Help browser doc inv inv(I-A) ans = 1.0358 0.0230 0.1046 0.2092 1.0148 0.0211 0.1089 0.0228 1.0211 X=inv(I-A)*D X = 4.8117 2.9923 1.5566 quit