'Adding information to excel sheet using matlab without xlswrite

I want to add information to the end of an excel sheet using MATLAB R2019. However, MATLAB doesn't support xlswrite anymore

 [mainSize,~] = size(mainraw);
 xlswrite('test.xlsx',A,1,int2str(mainSize+1));

how can I make it work on MATLAB R2019?



Solution 1:[1]

You are correct that xlswrite has been deprecated. As mentioned in the xlswrite docmentation the alternatives are writetable, writematrix, and writecell.

For your case try to use writematrix to append data to the contents of Sheet1; as in:

writematrix(A,'test.xlsx','Sheet','Sheet1','Range','A1', ...
           'WriteMode','append');

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1