MATLAB Answers

How to remove numbers from a cell array

60 views (last 30 days)
This question was flagged by Stephen Cobeldick
how can I remove the digits and "" mark from a cell array? i.e I want {["ABC100"], ...} to be changed to {[ABC], ...}.


Show 1 older comment
Codemaster on 9 Jun 2020
Hello, my question had some data that were not supposed to be posted and I was recently noticed about that. I tried to delete my question but unfortunately there is not an option to do so. If there is a way to proceed on deleting this thread kindly let me know.
Stephen Cobeldick
Stephen Cobeldick on 9 Jun 2020
@Raad Shariat: when you post anything on MATLAB Answers it is under the following Terms of Use:
It clearly states that you licensed your contributions under the Creative Commons Attribution Share Alike 3.0 license. By accepting those Terms of Use you gave permision to everyone to copy, alter, and distribute your contribution, as long as they follow the requirements of that license. For two years anyone could have done that.
This page has likely already been archived by various bots that copy MATLAB Answers, so I doubt that you can remove that data from the internet.
Codemaster on 9 Jun 2020
Thank you so much Stephen for clearing that out. Yes I am aware of the terms of use, that's why I was looking for an alternate to delete this thread entirely eventhough some time has passed by. Nevertheless it was very nice of you to spend your time on reminding me them! I wish you best of luck

Sign in to comment.

Accepted Answer

Stephen Cobeldick
Stephen Cobeldick on 24 Jan 2018
Edited: Stephen Cobeldick on 24 Jan 2018
A trivial implementation using regexprep:
D = regexprep(C,'[\d"]','');
And tested:
>> C = {'["LAN310"]';'["SHA550"]';'["SHA430"]';'["SHB331"]';'["EDU110"]', ... };
>> D = regexprep(C,'[\d"]','');
>> D{:}
ans = [LAN]
ans = [SHA]
ans = [SHA]
ans = [SHB]
ans = [EDU]
... etc


Sign in to comment.

More Answers (0)