Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

Adding information to excel sheet using matlab

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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');

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...