Split column in table based on character
    10 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Dion Theunissen
 el 3 de Ag. de 2021
  
    
    
    
    
    Comentada: Walter Roberson
      
      
 el 3 de Ag. de 2021
            Hi, 
I have a table with a string column. Now i want to split this column in 3 seperate coluns. 
In that column are strings like this:
["51∞ 13' 51,6""]
I want to create new columns like:
[51],[13], [51.6]
Anyone who can help me with this?
0 comentarios
Respuesta aceptada
  Walter Roberson
      
      
 el 3 de Ag. de 2021
        S = "51∞ 13' 51,6"""
str2double(regexp(regexprep(S, ',', '.'),'[\d.]+', 'match'))
Is it possible for + or - to appear? How is N vs S or E vs W denoted?
3 comentarios
  Walter Roberson
      
      
 el 3 de Ag. de 2021
				 S = [
    "51∞ 14' 12,9"""
    "51∞ 8' 40,2"""
    "51∞ 16' 43,3"""
    "51∞ 8' 40,3"""
    ]
 cell2mat(cellfun(@str2double,regexp(regexprep(S, ',', '.'),'[\d.]+', 'match'), 'uniform', 0))
Más respuestas (0)
Ver también
Categorías
				Más información sobre Tables 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!

