Find underscores and have them deleted?
1 view (last 30 days)
Show older comments
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 Comments
Walter Roberson
on 17 Jul 2020
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.
Accepted Answer
Walter Roberson
on 17 Jul 2020
origvars = TT.Proprties.VariableNames;
newvars = regexprep(origvars, '_', '');
has_unit = contains(origvars, '_Units');
TT.Properties.VariableNames = newvars;
TT(:,has_unit) = [];
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!