1

So i have been reading this pseudocode which looks like this:

%setting up matrix A
    for vertex = 1...n
        a(vertex,vertex) := number of direct neighbors;
        for the direct neighbors of vertex
            if the neighbor is not a pole
                a(vertex,neighbor) := -1;

My question is what does := mean here? Is it this?:

a(vertex,vertex) = a(vertex,vertex)+number of direct neighbors;

or is it this:

a(vertex,vertex) = number of direct neighbors;
horchler
  • 18,384
  • 4
  • 37
  • 73
Sahil Chaudhary
  • 493
  • 2
  • 10
  • 29
  • See this previous question for more than you want to know about `:=`: [http://stackoverflow.com/questions/5344694/what-does-do](http://stackoverflow.com/questions/5344694/what-does-do). Also see this Wikipedia article: [http://en.wikipedia.org/wiki/Assignment_(computer_science)](http://en.wikipedia.org/wiki/Assignment_(computer_science)). – horchler Jun 02 '13 at 18:54
  • What does this have to do with MATLAB? – Eitan T Jun 02 '13 at 22:04

1 Answers1

4

:= is traditionally the assignment operator, I don't see where any kind of addition would come from in this case.