how to convert logical into charactor

154 visualizaciones (últimos 30 días)
HARITHA Nambiar
HARITHA Nambiar el 18 de Mzo. de 2018
Editada: John D'Errico el 18 de Mzo. de 2018
what is the matlab code for converting a logical value to character value

Respuestas (2)

Von Duesenberg
Von Duesenberg el 18 de Mzo. de 2018
Try num2str.

John D'Errico
John D'Errico el 18 de Mzo. de 2018
Editada: John D'Errico el 18 de Mzo. de 2018
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'

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by