how catch number in "()"

조회 수: 1 (최근 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에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by