How to replace exact char in a cell array from another reference cell array
3 ビュー (過去 30 日間)
古いコメントを表示
Hello,
Given the example below
A = {'x1', 'x10', 'x1:x10'};
B = {'x1','x10'};
C = {'Pierre', 'Paul'};
I would like to replace in A the exact string from B by its respective value from C. I would like to obtain:
A={'Pierre', 'Paul', 'Pierre:Paul'}
I would like to minimize the number of loops necessary.
A=replace(A,B,C);
This doest not work and produce: {'Pierre'} {'Pierre0'} {'Pierre:Pierre0'}
I tried few regexprep and strrep without success. What is the proper way? Thank you
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!