Find a minimum spanning tree
问题 Could you please tell me why this MATLAB code is wrong? I don't understand why. Thank you so much in advance. function [mst, cost] = prim(A) [n,n] = size(A); A, n, pause, if norm(A-A','fro') ~= 0 , disp(' Error: Adjacency matrix must be symmetric ') return, end; intree = [1]; number_in_tree = 1; number_of_edges = 0; notintree = [2:n]'; number_notin_tree= n-1; in = intree(1:number_in_tree), out = notintree(1:number_notin_tree), pause, while number_in_tree < n, mincost = Inf; for i=1:number_in