フィルターのクリア

Replace multiple values

3 ビュー (過去 30 日間)
Lusine
Lusine 2012 年 5 月 12 日
Hi everyone I need to replace multiple values to one but when using strrep function I have to do this many times and specify oldSubstr one at a time, is there a method to do this in a more convinient way.
  1 件のコメント
Andrei Bobrov
Andrei Bobrov 2012 年 5 月 12 日
your example

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 5 月 12 日
use function regexprep
eg:
c = {'c:\cookies.m'; ...
'c:\candy.m'; ...
'c:\calories.m'};
d = regexprep(c, {'co' 'can' 'cal'}, 'N_')
  1 件のコメント
Lusine
Lusine 2012 年 5 月 12 日
Thanks!

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

その他の回答 (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