12345678910111213141516171819202122232425 |
- function [network] = SavePropertiesData(filePrefix, network, properties, numNodes)
-
- fprintf('saving properties data %s ...\n',filePrefix);
- n = size(network,1);
- m = size(network,2);
-
- fileID1 = fopen(strcat(filePrefix,'_1.txt'),'w');
- fileID2 = fopen(strcat(filePrefix,'_2.txt'),'w');
-
- if nargin >= 4
- fprintf(fileID1,'%%Nodes\t%d\n',numNodes);
- end
-
- for i=1:n
- for j=1:m
- if network(i,j) == 1
- fprintf(fileID1,'%d\t%d\t%d\n',i,j,properties(i,j));
- elseif i~=j && properties(i,j) > 0
- fprintf(fileID2,'%d\t%d\t%d\n',i,j,properties(i,j));
- end
- end
- end
-
- fclose(fileID1);
- fclose(fileID2);
|