fork download
  1. for i=1:1000
  2. x(i) = randi(10);
  3. end
  4.  
  5. y = zeros(1,10);
  6.  
  7. for i=1:1000
  8. y(x(i)) = y(x(i)) + 1;
  9. end
  10.  
  11. y
Success #stdin #stdout 0.41s 65144KB
stdin
Standard input is empty
stdout
y =

    94   109   101   109    96    99    93   115   105    79