Respuesta aceptada

Guillaume
Guillaume el 11 de Oct. de 2018
Editada: Guillaume el 11 de Oct. de 2018

2 votos

We could have done with an explanation of what the fields of your structure actually represent.
Assuming that the field A is the adjacency matrix of your graph (you really should have told us that), then:
matcontent = load('dolphins.mat');
network = graph(matcontent.Problem.A, cellstr(matcontent.Problem.aux.nodename));
plot(network);
See the documentation of graph.plot for the various plotting options as the default plot is quite messy. In particular, you may want to play with the 'Layout' option.
edit: fixed typo in nodename

3 comentarios

Isaac Osei Agyemang
Isaac Osei Agyemang el 11 de Oct. de 2018
Please I'm getting the attached error
Guillaume
Guillaume el 11 de Oct. de 2018
It was an obvious typo of the name of one your variables which you should have spotted yourself:
network = graph(matcontent.Problem.A, cellstr(matcontent.Problem.aux.nodename));
plot(network);
Isaac Osei Agyemang
Isaac Osei Agyemang el 11 de Oct. de 2018
Thanks, this the outcome I was expecting. Thanks Guillaume.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Networks en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by