How can I replace "" entries in a table?

3 ビュー (過去 30 日間)
Kamal Premaratne
Kamal Premaratne 2020 年 5 月 28 日
コメント済み: Kamal Premaratne 2020 年 5 月 28 日
I imported a large table (300 x 450) and some of the blank entries were imported as "". For the purpose of this question, let me take a part of one column:
>> TT = T(end-4:end,end)
TT =
5×1 table
vm2PR
_____
VC02 ""
VC03 ""
VC04 "6"
VC05 "2"
VC06 ""
How do I replace these "" entries with numerical value 0.0 and the "2" and "6" entries as numerical values 2 and 6 respectively? This has to be done for the whole large table (which is named T). Thank you.

採用された回答

madhan ravi
madhan ravi 2020 年 5 月 28 日
iX=str2double(TT.vm2PR);
TT.vm2PR(isnan(iX))=0
  1 件のコメント
Kamal Premaratne
Kamal Premaratne 2020 年 5 月 28 日
This works perfectly. Thank you so much Madhan.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by