Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc;
- clear all;
- close all;
- format long e;
- e=0.0001;
- A=[1 2; 1 2+e];
- b=[4;4+e];
- %cramer
- %wx=[4 2;4+e 2+e];
- %wx=det(wx);
- %wy=[1 4;1 4+e];
- %wy=det(wy);
- %det(A);
- %x=wx/det(A);
- %y=wy/det(A);
- %odwracanie macierzy
- %iA=inv(A);
- %odwroc=iA*b;
- %disp(odwroc);
- %Gauss
- %if det(A);
- %x=A\b;
- %sp=A*e;
- %end
- %LUv1
- %[L,U]=lu(A)
- %lu1=inv(U)*inv(L)*b
- %LUv2
- %[L,U]=lu(A)
- %ylu2=inv(L)*b
- %xlu2=inv(U)*ylu2
- %QR
- %[q,r] = qr(A)
- %xgr=inv(r)*q'*B
- %QR2
- %[Q, R]=qr(A)
- %xqr2=inv(R)*Q'*B
- %SVD
- %[U, S, V]=svd(A);
- %xsvd=inv(V)*inv(S)*U'*B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement