%please load ica1.1\demobreast first
filestr='train_data_1.asc';
%filestr='test_data_1.asc';
dims=9;
xdims = 9;
[A]=readata(dims,filestr);
X=A';
mx=max(max(abs(A')));
%mn=mx'*ones(1,size(X,2));
X=X/mx;
X=W*X;
A=X';
filestr='train_labels_1.asc';
%filestr='test_labels_1.asc';
[B]=readata(1,filestr);
A=[A B];
filename='breast5.dat';
%filename='breast3v.dat';
fid=fopen(filename,'w');
[xx yy]=size(A);
stringp = '';
for i = 1:xdims+1
  stringp = [stringp '%8.7f '];
end
stringp = [stringp '\n'];
for i =1:xx
   fprintf(fid,stringp,A(i,:));
end
fclose(fid);


filestr='test_data_1.asc';
dims=9;
xdims = 9;
[A]=readata(dims,filestr);
X=A';
mx=max(max(abs(A')));
%mn=mx'*ones(1,size(X,2));
X=X/mx;
X=W*X;
A=X';
filestr='test_labels_1.asc';
[B]=readata(1,filestr);
A=[A B];
filename='breast5v.dat';
fid=fopen(filename,'w');
[xx yy]=size(A);
stringp = '';
for i = 1:xdims+1
  stringp = [stringp '%8.7f '];
end
stringp = [stringp '\n'];
for i =1:xx
   fprintf(fid,stringp,A(i,:));
end
fclose(fid);
