How to rename a vertices of agraphs
이전 댓글 표시
Here is the code that I'm trying to rename graph nodes as a,b,c in output. But it shows error
a=[1 2 3];
b=[3 2 1];
g=graph(a,b);
p=plot(g);
c=[a b c];
p.NodeLabel=[c];
채택된 답변
추가 답변 (1개)
Shanmugavelan S
2021년 12월 24일
0 개 추천
댓글 수: 1
B = bucky;
g = graph(B(1:20, 1:20));
h = plot(g);
figure
h2 = plot(g);
h2.NodeLabel = string(2:2:40); % or
figure
h3 = plot(g);
h3.NodeLabel = "a" + (1:20);
카테고리
도움말 센터 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



