convert Char to string type
412 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
garima sharma
am 1 Aug. 2022
Kommentiert: Walter Roberson
am 1 Aug. 2022
I am reading data from serial port in the char format. the data format is
data = 1 2.2345
(1*9 char size {including space after 1, and new line character 5})
how to convert char into string?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 1 Aug. 2022
string(data)
2 Kommentare
Walter Roberson
am 1 Aug. 2022
Ah I just noticed that you are using r2016a. string() objects were added in r2016b, so you cannot convert to string() objects in your release.
In your release you would use char vectors or cell array of character vectors; see also cellstr()
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!