function pajek(adj_mat,n,filename) fid = fopen(filename,'w'); % fid2 = fopen('satis.clu','w'); fprintf(fid, '*Vertices %d\n',n); % fprintf(fid2, '*Vertices %d\n',n); % fid2 = fopen('labels_puc.clu', 'w'); for i=1:n affil = char(subjects(sub_sort(i)).my_affil); if strmatch(affil, 'mlgrad') token = 1; shape = 'triangle'; color = 'Red'; elseif strmatch(affil, 'sloan') token = 2; shape = 'circle'; color = 'Blue'; elseif strmatch(affil, '1styeargrad ') token = 3; shape = 'diamond'; color = 'Orange'; else token = 4; shape = 'box'; color = 'White'; end fprintf(fid,'%d "%s" %s x_fact 1.5 y_fact 1.5 ic %s\n',i, affil, shape, color); % fprintf(fid,'%d *%s*\n',i, char(survey_txt(find(==(subjects(i)))+offset, 13))); % fprintf(fid2,'%d\n', token); % fprintf(fid2,'%d\n',sat_support(i)); % i=i+1; end fprintf(fid, '*Arcs\n'); %fprintf(fid, '*Edges\n'); for i=1:n for j=1:n if adj_mat(i,j)>0 % arbitrary threshold fprintf(fid, '%d %d %d\n',i,j,adj_mat(i,j)); end end end fclose(fid); % fclose(fid2);