MATLAB: Appending a file

appendtext file

i have a file called hello.txt using wordpad which contains the matrix
2 7 3
2 6 9
now i have a vector v = [1 2 3] and i want to add this vector to the hello.txt file so when i open the hello.txt file i should have
2 7 3
2 6 9
1 2 3
how can i do this

Best Answer

fid = fopen('hello.txt', 'a+');
fprintf(fid, '%d %d %d\n', v);
fclose(fid);