代码结果显示:函数或变量 'degrees' 无法识别
[deg,,]=degrees(adj); % degrees
comp_mat={}; % initialize components matrix
for i=1:length(deg)
if deg(i)>0
done=0;
for x=1:length(comp_mat)
if length(find(comp_mat{x}==i))>0 % i in comp_mat(x).mat
done=1;
break
end
end
if not(done)
comp=find_conn_compI(adj,i);
comp_mat{length(comp_mat)+1}=comp;
end
elseif deg(i)==0
comp_mat{length(comp_mat)+1}=[i];
end
end
find_conn_comp
函数或变量 'degrees' 无法识别。
出错 find_conn_comp (第 10 行)
[deg,,]=degrees(adj); % degrees
怎么跑成功呀 感谢各位大佬帮助!
MATLAB中弧度转角度用rad2deg
https://ww2.mathworks.cn/help/matlab/ref/rad2deg.html
图节点的度
https://ww2.mathworks.cn/help/matlab/ref/graph.degree.html