Code covered by the BSD License  

Highlights from
MGraph

from MGraph by junbai wang
Probabilistic graphical models for reconstruction of genetic regulatory networks using DNA microarra

isundirected=MGraph_isundirected(G)
function isundirected=MGraph_isundirected(G)
%check whether the input G is undirected graph

ug=triu(G);
lg=tril(G);

[la lb]=find(lg);
temp_lg=zeros(size(G));
for i=1:length(la)
    temp_lg(lb(i),la(i))=1;
end

isundirected=sum(sum(abs(ug)-temp_lg))==0;

Contact us at files@mathworks.com