Comma separated value to vector

10 visualizaciones (últimos 30 días)
Matthew Tyler Jeffries
Matthew Tyler Jeffries el 9 de Mayo de 2019
Comentada: Matthew Tyler Jeffries el 9 de Mayo de 2019
I have a table where the element in the first row of the second column is "11,333,4445,2,78,2399". I would like to take this element, remove the commas, and turn it into a vector v=[11 333 4445 2 78 2399].

Respuesta aceptada

Stephen23
Stephen23 el 9 de Mayo de 2019
>> S = '11,333,4445,2,78,2399';
>> V = sscanf(S,'%f,',[1,Inf])
V =
11 333 4445 2 78 2399
  1 comentario
Matthew Tyler Jeffries
Matthew Tyler Jeffries el 9 de Mayo de 2019
Brilliant! This is exactly what I need. Thank you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by