MATLAB: How to add values to an existing *.dat file

.dat fileaddcsvwrite

Hello to all, I am sorry if this topic has been discussed earlier, but I could not find it… Can you please give me an idea how to add (record) value to an existing my_datta.dat file, created as csvwrite file. I would like to add values every time when I change the input datta, and not to overwrite the file. Thanks!

Best Answer

csvwrite() calls dlmwrite() with ',' as the delimiter. You can call dlmwrite() directly, in which case you could use
dlmwrite(filename, M, '-append')