How to convert a vector to a string (Matlab2016a)

hi everyone,
i want to convert a vector to a string, how can i do it in matlab2016a
for example A = [ 1 2 3]
thanks in advance

답변 (1개)

dpb
dpb 2020년 12월 12일

0 개 추천

For what definition of "string"?
>> A=1:3;
>> num2str(A)
ans =
'1 2 3'
>> num2str(A.')
ans =
3×1 char array
'1'
'2'
'3'
>> string(A) % requires R2016b
ans =
1×3 string array
"1" "2" "3"
>>

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

릴리스

R2016a

태그

질문:

2020년 12월 12일

댓글:

dpb
2020년 12월 12일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by