Thanks guys! with your thoughts I got it :) I had to put the fprintf stament inside of three loops, 1 for the rows, 1 for the cols, and 1 for the block_number.
% code
[row,col, block_number] = size(calculated_data_from_above);
for b=1:block_number
fid = fopen('output_file.dat', 'wt');
for i= 1:col
for n = 1:row
equations to generate data_A data_B data_C
data_to_print = [ block_number data_A data_B data_C ];
fprintf(fid, '%d %0.6f %d %0.6f\n',data_to_print);
end
end
end
fclose all;
%code
I'm not really sure why all of this works (parts I undrstand, other parts I got from you guys) but just kept playing around with it till it ran, yea :)
hopefully I can use some of this for my next MatLab challenge, thanks guys, Tabby