set_matrix(g,A) --- set g to be the graph specificed in the matrix A. The matrix is scanned by check_matrix to be sure it is a valid adjacency matrix. If it is not, an error is triggered and the graph is left unchanged.
0001 function set_matrix(g,A) 0002 % set_matrix(g,A) --- set g to be the graph specificed in the matrix A. 0003 % The matrix is scanned by check_matrix to be sure it is a valid adjacency 0004 % matrix. If it is not, an error is triggered and the graph is left 0005 % unchanged. 0006 0007 if (~check_matrix(A)) 0008 error('Input matrix is not a valid adjacency matrix') 0009 end 0010 0011 fast_set_matrix(g,logical(A)); 0012