How to delete specific text from multiple cell in a column ?

3 vues (au cours des 30 derniers jours)
Cristian Martin
Cristian Martin le 13 Juin 2020
Commenté : Cristian Martin le 13 Juin 2020
Hi!
I have the following column :
21.15 (cd)
42.12 (cd)
24.45 (cd)
..............
It must show like this, without brackets and text :
21.15
42.12
24.45
..............
Thanks in advance guys !

Réponse acceptée

madhan ravi
madhan ravi le 13 Juin 2020
Modifié(e) : madhan ravi le 13 Juin 2020
c = {'21.15 (cd)';...
'42.12 (cd)';...
'24.45 (cd)'};
func = @(x) sscanf(c{x},'%f');
Wanted = arrayfun(func,1:numel(c)).'
  1 commentaire
Cristian Martin
Cristian Martin le 13 Juin 2020
Hi Ravi, for my matrix I will have allways each time a different string of numbers, only text in brackets will be the same, so I need something that will scan and erase only text...Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by