Text exceeds maximum line length of 25,000 characters for Command Window display.

2 visualizaciones (últimos 30 días)
I'm building a directed graph with about 16,000 nodes and 70,000 edges and I would like to run the graphallshortestpaths function. The graph is acyclic and unweighted (I have a weighting matrix of all 1's anyway).
I entered into the command window:
>> W = [1 1 1 1 ...1] (this is the weighting matrix.
>> DG = sparse([1 1 3 4 5 6 ... 68201],[46 809 47088 2281 ... 5006],W)
However, when I try to show DG, I get the following error message:
(first 25000 characters of intended output) Output truncated. Text exceeds maximum line length of 25,000 characters for Command Window display. >> >>
Is there any workaround that would let me work with this entire graph?

Respuestas (1)

Nade Sritanyaratana
Nade Sritanyaratana el 6 de Ag. de 2014
How are you showing DG? It sounds like you are trying to display this entire graph in the command window.
The error only pertains to the display. You can try printing parts of the graph into the command window if this is what you wish; there's an article that also discusses this error further .
However, if you are hoping to display DG, you may want to use something like the view / biograph functions, as in this example inside the graphallshortestpaths documentation page .
e.g.,
>> view(biograph(DG,[],'ShowWeights','on'))
Lastly, if you are looking for a command window-like output, you can also try printing the entire output of DG to a textfile using fprintf.
  2 comentarios
Pat
Pat el 6 de Ag. de 2014
Thanks for the help.
To display DG, I just typed in
>> DG = sparse([1 1 3 4 5 6 ... 68201],[46 809 47088 2281 ... 5006],W)
into the command line and got the previous error message. I added a semicolon to the end of that line and am still getting the error message. DG isn't saving into the Workspace like W did.
Nade Sritanyaratana
Nade Sritanyaratana el 6 de Ag. de 2014
Can you please attach the inputs you are using for i, j, and W? It would be useful to see the inputs you are using for sparse:
>> DG = sparse(i,j,W)

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by