Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.51 KB | None | 0 0
  1. function weightMatrix = generateWeights(numberOfBits,numberOfPatterns,P)
  2. %GENERATEWEIGHTS Summary of this function goes here
  3. %   Detailed explanation goes here
  4. %Ett mönster
  5. weightMatrix = zeros(numberOfBits);
  6. for p = 1:numberOfPatterns;
  7.     for i = 1:numberOfBits;
  8.         for j = 1:numberOfBits;
  9.             weightMatrix(i,j) = weightMatrix(i,j) + P(i,p)*P(j,p);
  10.         end
  11.     end
  12. end
  13.  
  14. weightMatrix = weightMatrix - diag(diag(weightMatrix)); %Sets w(i,i) = 0
  15. weightMatrix = weightMatrix/numberOfBits;
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement