Make an n × n random matrix a) calculates its inverse b) Multiply the two back together c) calculates the residual (difference from the desired n × n identity matrix eye(n))
Make an n × n random matrix |
b) Multiply the two back together
c) calculates the residual (difference from the desired n × n identity matrix eye(n))
c) calculates the residual (difference from the desired n × n identity matrix eye(n))
Solution:
j=rand(2)
k=inv(j)mul=k*j
mul=k*j
ide=mul-eye(2)
Comments
Post a Comment