Path: news.mathworks.com!not-for-mail
From: "Owen " <owen.daniel@removethis.warwick.ac.uk>
Newsgroups: comp.soft-sys.matlab
Subject: Using Graphviz in Matlab.
Date: Wed, 14 Oct 2009 17:36:20 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <hb526j$if1$1@fred.mathworks.com>
Reply-To: "Owen " <owen.daniel@removethis.warwick.ac.uk>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255541780 18913 172.30.248.35 (14 Oct 2009 17:36:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 Oct 2009 17:36:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1246264
Xref: news.mathworks.com comp.soft-sys.matlab:577292


Hi,

I am trying to use Matlab for some graph theory problems, and have been trying to follow this (http://www.stanford.edu/~dgleich/demos/matlab/random_graphs/erdosreyni.html) tutorial for random graphs which uses the program Graphviz. I have also downloaded the relevant interface (http://www.mathworks.com/matlabcentral/fileexchange/4518) between matlab and graphviz.

However, when I try to run through the example problem (in the first link), I get an error. After entering

[x,y] = draw_dot(G);

I get the following error,

??? Attempted to access node_pos(2); index out of bounds because numel(node_pos)=1.

Error in ==> dot_to_graph at 94
        y(lst_node) = node_pos(2);

Error in ==> draw_dot at 30
[trash, names, x, y] = dot_to_graph(tmpLAYOUT);  % load NEATO layout

Is anybody able to explain how to get around this?

Thank you.