Borrar filtros
Borrar filtros

strtok return nothing

1 visualización (últimos 30 días)
Fan
Fan el 7 de Sept. de 2011
Hi, all,
I have a question about strtok.
Run [T,D]=strtok(num2str(5.5),'0.5') return T='' D=''
what's wrong? other number works fine.

Respuesta aceptada

Paulo Silva
Paulo Silva el 7 de Sept. de 2011
There's no 0.5 delimiter on the string, strtok should return T=5.5 but it doesn't, that's weird because it says on the documentation: If no delimiters are found in the body of the input string, then the entire string (excluding any leading delimiting characters) is returned in token, and remain is an empty string ('')
Like this [T,D]=strtok(num2str(5.5),0.5) it works like it says on the documentation.

Más respuestas (1)

Fan
Fan el 30 de Sept. de 2011
[T,D]=strtok(num2str(5.5),'.5') return T='' D='' have the same problem.

Categorías

Más información sobre String Parsing 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