Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. % Data: ID, Index, Weight, Category
  2. A0=[1 1121 204 1;...
  3. 2 2212 112 1;...
  4. 3 2212 483 3;...
  5. 4 4334 233 1;...
  6. 5 4334 359 2;...
  7. 6 4334 122 3 ];
  8.  
  9. % Current Result
  10. A1=pivottable(A0,[2],[],[3],{@max}); % Pivot Table
  11. A1=cell2mat(A1); % Convert to array
  12.  
  13. >>A1=[1121 204;...
  14. 2212 483;...
  15. 4334 359 ]
  16.  
  17. % Required Result
  18. >>A0=[1 1121 204 1;...
  19. 3 2212 483 3;...
  20. 5 4334 359 2 ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement