merge txt and num back again.

4 ビュー (過去 30 日間)
mirewuti muhetaer
mirewuti muhetaer 2020 年 3 月 27 日
コメント済み: Walter Roberson 2020 年 3 月 27 日
Hi,
i get the num and txt by using following code:
[num, txt]=xlsread('david.xls');
after i deal with some other process and filled the empty num with numbers, then i want to merge the num and txt back again and save it in the excel format.
But i could not find any helpful approach.
Thanks.

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 3 月 27 日
If you must use xlsread() then use the third output of xlsread(), often known as raw, which will be a cell in which each entry that could be converted to numeric has been converted, and all others are text. You would then manipulate the cell array, and eventually xlswrite() the cell array.
However these days we firmly recommend that you use readtable() instead, and manipulate the table entries, and then writetable()
  2 件のコメント
mirewuti muhetaer
mirewuti muhetaer 2020 年 3 月 27 日
can you tell me the code of wlswrite by using raw?.
Thanks.
Walter Roberson
Walter Roberson 2020 年 3 月 27 日
xlswrite('new_david.xls',YourCellArray)
Note: you will not be able to write a cell with xlswrite unless you are using Windows with Excel installed. Otherwise you will need to use writetable() or writecell()

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

カテゴリ

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