how catch number in "()"

2 次查看(过去 30 天)
piero
piero 2023-9-19
编辑: Voss 2023-9-19
f={"1A(12)","cB(34)","4C(23)"}
i want catch array with 12 34 and 23

采纳的回答

Voss
Voss 2023-9-19
编辑:Voss 2023-9-19
f={"1A(12)","cB(34)","4C(23)"};
C = regexp(cellstr(f),'\((.*)\)','tokens','once');
C = [C{:}]
C = 1×3 cell array
{'12'} {'34'} {'23'}
N = str2double(C)
N = 1×3
12 34 23

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operators and Elementary Operations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by