Azzera filtri
Azzera filtri

how catch number in "()"

2 visualizzazioni (ultimi 30 giorni)
piero
piero il 19 Set 2023
Modificato: Voss il 19 Set 2023
f={"1A(12)","cB(34)","4C(23)"}
i want catch array with 12 34 and 23

Risposta accettata

Voss
Voss il 19 Set 2023
Modificato: Voss il 19 Set 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

Più risposte (0)

Categorie

Scopri di più su Operators and Elementary Operations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by