" I would like to rid of the last row and column of the 7x7 matrix and get 6x6 for further computation. "
That would simply be if you have matrix M
Sorry, I got interrupted and had to leave for a while...figured might as well send what had already typed..
Use writetable or writematrix instead depending upon the form -- if as above, you just have a matrix M, then writematrix is the suitable function.
Then you have to decide how you want to save the data -- then whether you want the data with/without header(s), on one or sequential sheets in the workbook, etc., etc., etc., ...
To continue to write at the end of the existing data, use the 'WriteMode', 'append'
You can fix to use 'overwrite' (the default if don't specify at all) the first pass through the loop with an "if...else...end" construct to begin again if the file already has data in it and want to start fresh.
All up to you to decide what you want/need...