Facebook
From RuchamPsaJakSra, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 229
  1. A=[1 2 3];
  2. B=[4 5 6];
  3. C=[7 8 9];
  4. mat=[A;B;C];
  5. if rank(mat)==3
  6.     fprintf('Uklad jest liniowo niezalezny');
  7.     return;
  8. end
  9. syms x y;
  10. f1=x*B+y*C-A;
  11. f2=x*A+y*C-B;
  12. f3=x*A+y*B-C;
  13. [x1,y1]=solve(f1);
  14. [x2,y2]=solve(f2);
  15. [x3,y3]=solve(f3);
  16. v1=[x1 y1]
  17. v2=[x2 y2]
  18. v3=[x3 y3]