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

5 ビュー (過去 30 日間)
KenL
KenL 2016 年 10 月 3 日
コメント済み: KenL 2016 年 10 月 3 日
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.
KenL
KenL 2016 年 10 月 3 日
Hi...I did a mistake. Now, problem solved. Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by