How to remove single quotes using regexprep
9 ビュー (過去 30 日間)
古いコメントを表示
I would like to know how can we eliminate the single quotes in a cell using regexprep. I have a 1x150000 cell array.
4 件のコメント
採用された回答
Jan
2011 年 2 月 9 日
STRREP is easier than REGEXPREP and needs the half processing time:
D = strrep(C, '''', '');
If the worm of quotes looks ugly, use:
D = strrep(C, char(39), '');
2 件のコメント
David Young
2011 年 2 月 9 日
Yes, strrep is far faster than regexprep on my test. How disappointing that regexprep doesn't recognise that it has this simple case and process it as fast as strrep does.
Manoj
2018 年 3 月 2 日
how to remove NAN and single quotes in case of cell array of matrix? And I want to convert that cell array in to matrix form? help me
その他の回答 (2 件)
Lakhan
2013 年 11 月 8 日
its not working in my case
if true
% code
>> a = {'hi'}
a =
'hi'
>> D = strrep(a, '''', '')
D =
'hi'
end
1 件のコメント
Walter Roberson
2013 年 11 月 8 日
Your string does not contain quotation marks. You have created a cell array, and string elements of a cell array are displayed surrounded by quote marks. Look at
a{1}
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!