For loop not working through matrix
Show older comments
I am trying to pull the data from each row of the entire 100x2 int16 matrix of "cr" and print in my file 'conc.dat'. However, only one row is being printed, it does not seem like my for loop is going through the entire matrix. Can someone help me figure out why and how to fix this issue?
for k = 1:length(cr);
row = cr(k,:);
conc = counts(row(:,1));
fileID = fopen('conc.dat','w');
fprintf(fileID,'\n');
fprintf(fileID,'%12.f\n',conc);
fclose(fileID)
end
Accepted Answer
More Answers (0)
Categories
Find more on Low-Level File I/O in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!