function CowordMatrix()
[OriginalData]=xlsread('C:\keyword.xls');
[TargetSet]=xlsread('C:\Hfkw.xls');
OutputData=zeros(length(TargetSet),length(TargetSet));
for ForRow=1:length(TargetSet)
for FolCol=1:(length(TargetSet))
OutputData(ForRow,FolCow)=CowordMatrix(TargetSet(ForRow),TargetSet(ForCol),OriginalData);
end
end
xlswrite('Output.xls',TargetSet,'Sheet1','B1');
xlswrite('Output.xls',TargetSet','Sheet1','A2');
xlswrite('Output.xls',OutputData,'Sheet1','B2');
end
function OutputNumber =countMatrix(Number1,Number2,Matrix)
MatrixRow=size(Matrix,1);
OutputNumber=0;
for ForRow=1:MatrixRow
FlagNumber1=ismember(Number1,Matrix(ForRow,:));
FlagNumber2=ismember(Number2,Matrix(ForRow,:));
if FlagNumber1+FlagNumber2==2
OutputNumber=OutputNumber+1;
end
end
end
[OriginalData]=xlsread('C:\keyword.xls');
[TargetSet]=xlsread('C:\Hfkw.xls');
OutputData=zeros(length(TargetSet),length(TargetSet));
for ForRow=1:length(TargetSet)
for FolCol=1:(length(TargetSet))
OutputData(ForRow,FolCow)=CowordMatrix(TargetSet(ForRow),TargetSet(ForCol),OriginalData);
end
end
xlswrite('Output.xls',TargetSet,'Sheet1','B1');
xlswrite('Output.xls',TargetSet','Sheet1','A2');
xlswrite('Output.xls',OutputData,'Sheet1','B2');
end
function OutputNumber =countMatrix(Number1,Number2,Matrix)
MatrixRow=size(Matrix,1);
OutputNumber=0;
for ForRow=1:MatrixRow
FlagNumber1=ismember(Number1,Matrix(ForRow,:));
FlagNumber2=ismember(Number2,Matrix(ForRow,:));
if FlagNumber1+FlagNumber2==2
OutputNumber=OutputNumber+1;
end
end
end
