Why doesnt int2str return string
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
David Zhang
el 24 de Jun. de 2021
Comentada: David Zhang
el 24 de Jun. de 2021
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/664110/image.png)
Here is my code as as you can see I wanted to convert the element in row 1 column 4 from an int 1 to a string using int2str, but upon using isstring it turns out that it isn't one. Anybody know why?
0 comentarios
Respuesta aceptada
millercommamatt
el 24 de Jun. de 2021
It's turned your value into a char, not a string.
ischar(int2str(F{1,4})) should return true
If you look at the function help for int2str, you'll see this:
int2str returns character arrays only. Starting in R2016b, you can convert numeric arrays to string arrays using the string function.
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings 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!