Warning: Matrix is singular to working precision. HELP

This is my code :
sina=4/sqrt(4^2+5^2);
cosa=5/sqrt(4^2+5^2);
sinb=2/sqrt(2^2+5^2);
cosb=5/sqrt(2^2+5^2);
A=zeros(15:15);
A(1,1)=-1; A(1,13)=-cosa
A(2,9)=-1; A(2,13)=-sina
A(3,1)=1; A(3,2)=-1; A(3,14)=-cosa;
A(4,10)=-1; A(4,13)=-sina;
A(5,2)=1; A(5,3)=-cosb
A(6,3)=-sinb; A(6,11)=-1;
A(7,3)=cosb; A(7,4)=-cosb; A(7,15)=cosb;
A(8,3)=sinb; A(8,4)=-sinb; A(8,12)=-1; A(8,15)=-sinb;
A(9,5)=-1;
A(10,5)=1; A(10,6)=-1; A(10,13)=cosa;
A(11,10)=1; A(11,13)=sina;
A(12,7)=1; A(12,8)=-1;
A(13,12)=1;
A(14,4)=cosb; A(14,8)=1;
A(15,4)=sinb;
I get matrix A, but when I wrote this:
alfa=A^-1;
Matlab gives me error
I added some photos

Réponses (1)

madhan ravi
madhan ravi le 2 Jan 2019
Modifié(e) : madhan ravi le 2 Jan 2019
det(A) % is zero therefore the matrix is singular so the inverse does not exist
Try using
pinv(A)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by