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

2 次查看(过去 30 天)
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?

回答(1 个)

Nade Sritanyaratana
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 个评论
Pat
Pat 2014-8-6
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
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)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by