|
1234567891011121314151617181920212223 |
- function [dataWithAtt, totalAttNum] = CombineDataWithAttributes4(data, attData)
-
- totalAttNum = size(attData,2);
- sizeWithAtt = totalAttNum + size(data,1);
- dataWithAtt = sparse(sizeWithAtt, sizeWithAtt);
- dataWithAtt(totalAttNum+1:end,totalAttNum+1:end) = data;
-
- dataLines = size(data,1);
- attLines = size(attData,1);
- if (attLines ~= dataLines)
- fprintf('CombineDataWithAttributes - Invalid data sizes: data %d, attributes %d\n',dataLines,attLines);
- end
-
- for line=1:dataLines
- nnzAtt = find(attData(line,:));
- for att = nnzAtt
- dataWithAtt(totalAttNum+line,att)=1;
- dataWithAtt(att,totalAttNum+line)=1;
- end
- end
-
- dataWithAtt = sparse(dataWithAtt);
-
|