function A = txt_numbers_read(filename)
fid = fopen(filename,'rt');
if fid < 0
   fprintf('error opening file\n');
   return;
end

% Read file as a set of strings, one per line:
line_number = 1;
oneline{line_number} = fgets(fid);
while ischar(oneline{line_number})
   line_number = line_number + 1;
    oneline{line_number} = fgets(fid);
end
N_lines = line_number-1; % the last element is -1
fclose(fid);

% Parse the lines:
for ii = 1:N_lines
    A(ii,:) = sscanf(oneline{ii},'%f,');
end
