2013-06-02 214 views
1

所以我一直在阅读这个伪代码看起来像这样:阅读伪代码

%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; 

我的问题是什么意思:=这里?是不是这个?:

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

或者是这样的:

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

看到这个以前的问题超过你想知道':=':[http://stackoverflow.com/questions/5344694/what-does-do](http://stackoverflow.com/questions/ 5344694 /什么,做-DO)。另见维基百科文章:[http://en.wikipedia.org/wiki/Assignment_(computer_science)](http://en.wikipedia.org/wiki/Assignment_(computer_science))。 – horchler

+0

这与MATLAB有什么关系? –

回答

4

:=传统上是赋值运算符,我没有看到任何地方除了那种会来自于这种情况。