Convert numerical label Vector to char label
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,I want to convert a to b please a=[1 1 2 1 3 1 3 2] To b=[as as be as ce as ce be].
0 件のコメント
採用された回答
Star Strider
2022 年 6 月 4 日
編集済み: Star Strider
2022 年 6 月 4 日
Try this —
map = {'as','be','ce'}; % Cell Array
a=[1 1 2 1 3 1 3 2];
b = map(a)
b = strtrim(sprintf(' %s ',b{:}))
% To b=[as as be as ce as ce be].
map = ["as","be","ce"]; % String Array
a=[1 1 2 1 3 1 3 2];
b = map(a)
b = strtrim(sprintf(' %s ',b))
EDIT — (4 Jun 2022 at 2:48)
.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!