Advertisement
deushiro

Untitled

Mar 8th, 2021
1,105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.66 KB | None | 0 0
  1. a = [2 3 4];
  2. b = [3 5 2];
  3. c = [1 1 1];
  4.  
  5. aplusb = a + b;
  6. bplusa = b + a;
  7. is_equal = (aplusb == bplusa)
  8. is_equal_using_isequal = isequal(aplusb,bplusa)
  9.  
  10. figure
  11. grid on
  12. quiver3(0, 0,0, 2, 3,4, 1)
  13. hold on
  14. axis equal
  15. quiver3(0, 0,0, 3, 5,2)
  16. quiver3(0, 0,0, aplusb(1), aplusb(2), aplusb(3))
  17.  
  18.  
  19.  
  20. aplusbandthenplusc = (a + b) + c;
  21. aplusbplusc = a + (b + c);
  22. is_equal = (aplusbandthenplusc == aplusbplusc)
  23. is_equal_using_isequal = isequal(aplusbplusc, aplusbandthenplusc)
  24.  
  25. figure
  26. grid on
  27. quiver3(0, 0,0, 2, 3,4, 1)
  28. hold on
  29. axis equal
  30. quiver3(0, 0,0, 3, 5,2)
  31. quiver3(0,0,0,c(1),c(2),c(3))
  32. quiver3(0, 0,0, aplusbplusc(1), aplusbplusc(2), aplusbplusc(3))
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement