daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. how I can eliminate in a matrix all columns whose last two elements are equal? in Matlab
  2. A=[1 2 3 ; 4 5 6 ; 5 5 5]
  3.  
  4. A =
  5.  
  6.      1     2     3
  7.      4     5     6
  8.      5     5     5
  9.    
  10. A(:,A(end,:)==A(end-1,:))=[]
  11.  
  12. A =
  13.  
  14.      1     3
  15.      4     6
  16.      5     5
  17.    
  18. index = (A(:,end) == A(:,end-1) );
  19.    
  20. A(:,index) = [];
  21.    
  22. B = A( : , A(: , end-1) ~= A(: , end) )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top