Parallel and distributed systems exercise 2: ditributed all-kNN algorithm.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

15 wiersze
251 B

  1. function [M, I] = maxIdx(Vec)
  2. %maxIdx Calculate the max,index pair of each element of a vector
  3. %
  4. n = length(Vec);
  5. I = 0;
  6. M = -Inf;
  7. for j = 1:n
  8. if M < Vec(j)
  9. M = Vec(j);
  10. I = j;
  11. end
  12. end
  13. end