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

답변 (1개)

madhan ravi
madhan ravi 2019년 1월 2일
편집: madhan ravi 2019년 1월 2일
det(A) % is zero therefore the matrix is singular so the inverse does not exist
Try using
pinv(A)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2019년 1월 2일

편집:

2019년 1월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by