Borrar filtros
Borrar filtros

how catch number in "()"

2 visualizaciones (últimos 30 días)
piero
piero el 19 de Sept. de 2023
Editada: Voss el 19 de Sept. de 2023
f={"1A(12)","cB(34)","4C(23)"}
i want catch array with 12 34 and 23

Respuesta aceptada

Voss
Voss el 19 de Sept. de 2023
Editada: Voss el 19 de Sept. de 2023
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

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by