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!