Advertisement
LABDLS

determinante MATLAB

Aug 20th, 2014
7,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.26 KB | None | 0 0
  1. function d = determinante(X)
  2. idx=1:size(X,1);
  3. for k=1:size(X,1)
  4.     if size(X,1)==1
  5.         d=X;
  6.     else
  7.         idxf=idx(idx~=1);
  8.         idxc=idx(idx~=k);
  9.         d(k)=((-1)^(1+k))*X(1,k)*determinante(X(idxf,idxc));
  10.         d=sum(d);
  11.     end
  12. end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement