Find underscores and have them deleted?

3 ビュー (過去 30 日間)
ZH
ZH 2020 年 7 月 17 日
コメント済み: ZH 2020 年 7 月 18 日
I am trying to do three things before/after a retime
  • find the underscores and have them deleted
  • find all the columns with " _Units" and delete them
  • keep a column that has words in it
( the column with words in it does not work before being retimed because it does not like characters)
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 17 日
Please post code insted of images of code. WIth code we can copy and paste and revise, instead of having to type things in ourselves.
ZH
ZH 2020 年 7 月 18 日
I will keep in mind for next time.

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

採用された回答

Walter Roberson
Walter Roberson 2020 年 7 月 17 日
origvars = TT.Proprties.VariableNames;
newvars = regexprep(origvars, '_', '');
has_unit = contains(origvars, '_Units');
TT.Properties.VariableNames = newvars;
TT(:,has_unit) = [];

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by