How to update the text field from the loaded excel file in MATLAB?

1 次查看(过去 30 天)
I encountered a problem to update the text field from the loaded excel file in MATLAB.

采纳的回答

Walter Roberson
Walter Roberson 2016-10-3
[num, txt, raw] = xlsread('TheFilename.xlsx');
raw{7,11} = 'Some New String'; %update the location in memory
xlswrite('TheFilename.xlsx', raw) %store everything back
OR,
newcontent = 'Some New String';
xlswrite('TheFilename.xlsx', newcontent, 'K7:K7'); %update only the one location
  2 个评论
KenL
KenL 2016-10-3
Thanks for the prompt response. I managed to update the field at location of raw{7,11} but all my data before such location are replaced with "NaN". Please advise.

请先登录,再进行评论。

更多回答(0 个)

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by