Target must be a dense double array of node indices. How to Solve?
问题 I am trying to build a network graph with word adjacency data. But I am getting the error "Target must be a dense double array of node indices". Following is my code: fileName = 'adjnoun.gml'; inputfile = fopen(fileName); A=[]; l=0; k=1; while 1 % Get a line from the input file tline = fgetl(inputfile); % Quit if end of file if ~ischar(tline) break end nums = regexp(tline,'\d+','match'); %get number from string if length(nums) if l==1 l=0; A(k,2)=str2num(nums{1}); k=k+1; continue; end A(k,1)