MATLAB: Data appending in text file

data appending to a text file

Hi,
I created a text file using MATLAB. For example, 10 by 3 matrix and I saved it as a text using fopen and fprint in particular format. Now I want to append lines (data)to this text, say at row 1, row 5, and row 10, i.e at a fixed interval. How can I do this. Remember, I need to add lots of these lines.
I greatly appreciate any help.
Thanks Rafiq

Best Answer

Instead of opening the file with write permission using 'w', open it in with append permission using 'a'.