how to convert logical into charactor

what is the matlab code for converting a logical value to character value

답변 (2개)

John D'Errico
John D'Errico 2018년 3월 18일
편집: John D'Errico 2018년 3월 18일

2 개 추천

To answer the question you insist on asking multiple times.
L is a logical vector. C a character array.
L = rand(10,1) < .5
L =
10×1 logical array
1
1
0
1
1
0
1
1
1
1
C = reshape(char(L + '0'),5,2)
C =
5×2 char array
'10'
'11'
'01'
'11'
'11'

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2018년 3월 18일

편집:

2018년 3월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by