components</p><pre class="codeinput"><span class="comment">% get the number of strongly connected components</span>
max(scomponents(A))
</pre><pre class="codeoutput">
ans =

     3

</pre><pre class="codeinput"><span class="comment">% get the number of connected components</span>
max(scomponents(A|A'))  <span class="comment">% we make the graph symmetric first by "or"ing each entry</span>
</pre><pre class="codeoutput">
ans =

     2

</pre><p>Let's look at the vertices in the strongly connected components</