Error when plotting a small digraph

조회 수: 1 (최근 30일)
Steve Huntsman
Steve Huntsman 2018년 2월 15일
답변: Christine Tobler 2018년 2월 15일
Running
figure; plot(digraph([0,0,1;1,0,0;1,0,0]))
on R2016a throws the error
Error using svd
Input to SVD must not contain NaN or Inf.
Error in orth (line 15)
[Q,S] = svd(A,'econ'); %S is always square.
Error in matlab.internal.graph.MLGraph/subspaceLayout>layoutOneConnComp (line 55)
M = orth(M);
Error in matlab.internal.graph.MLGraph/subspaceLayout (line 29)
xy = layoutOneConnComp(G,dim,1:G.NodeCount,L,deg);
Error in matlab.graphics.chart.primitive.GraphPlot/layoutforce
Error in matlab.graphics.chart.primitive.GraphPlot/layout>layoutauto
Error in matlab.graphics.chart.primitive.GraphPlot/layout
Error in matlab.graphics.chart.primitive.GraphPlot
Error in digraph/plot (line 96)
hObj = matlab.graphics.chart.primitive.GraphPlot('BasicGraph', ...
Using (e.g.) the circle layout works fine. Is there a workaround that lets me use the default/force layout or must I resort to something like a try/catch?
  댓글 수: 5
Walter Roberson
Walter Roberson 2018년 2월 15일
I confirm there is a bug there. It appears to have been fixed in some later release.
Steve Huntsman
Steve Huntsman 2018년 2월 15일
Good to know I'm not doing something wrong. I'll work around it until I install R2018a.

댓글을 달려면 로그인하십시오.

채택된 답변

Christine Tobler
Christine Tobler 2018년 2월 15일
This bug was fixed in R2016b. I'm afraid there is no workaround except to check for the error and use another layout method ('circle' or 'layered'). This bug applies to a small set of directed graphs, undirected graphs are not affected.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by