A bug of build-in function Char?
Mostra commenti meno recenti
Well, I have a double array readed from a binary file, such as X=[66 43 22 0 67],
When I convert the array into string, char(X), the ans is 'B+! C'
I think that the function Char() should take [0] as the ending of a string, why it treat zero also as a part of string?
Risposta accettata
Più risposte (2)
yang
il 20 Dic 2012
0 voti
Walter Roberson
il 21 Dic 2012
sprintf('%s', char(X))
sprintf() has an undocumented effect (some would say it is a bug) of ending at the first binary 0.
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!