This is my current matlab code:
a = load('m1.txt');
b = load('m2.txt');
c = a*b;
fid = fopen('Matrix.txt','wt');
for ii = 1:size(c,1)
fprintf(fid,'%g\t',c(ii,:));
fprintf(fid,'\n');
end
fclose(fid)
Basically read in two files and multiply the result to get the multiplied matrix, and write it to a file.
I'm suppose to find out if there is a cache friendly way to do this. But I think matrix somewhat efficient in this area opposed to other programming languages sometimes. Any hints or sample code?
dlmwrite('Matrix1.txt',c,'delimiter', '\t')
and skip the for loop. – AGS