Why does char give me an empty output?
Ältere Kommentare anzeigen
>> b=[1,2,3,4,5]
b =
1 2 3 4 5
>> char(b)
ans =
this is what I enter and the output is five little empty boxes. I've tried this with several numeric vectors and matrices and it does the same thing with varying numbers of boxes. It also does this if I manually input the vector. It was working previously, and then it wasn't I'm not sure what I'm doing wrong
Akzeptierte Antwort
Weitere Antworten (2)
Joseph Cheng
am 21 Sep. 2015
1 Stimme
char() converts the values into the 7-bit ASCII characters. use num2str() or the other equivalent functions to convert numbers to a string.
1 Kommentar
Geri Spinosa
am 21 Sep. 2015
C.J. Harris
am 21 Sep. 2015
1 Stimme
This is because ASCII characters 1 to 7 are not visible characters.
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!