convert Char to string type
487 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2022-8-1
string(data)
2 个评论
Walter Roberson
2022-8-1
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()
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!