Borrar filtros
Borrar filtros

Concatinate number and character

1 visualización (últimos 30 días)
siddhesh rane
siddhesh rane el 25 de Jul. de 2013
I have numerical data in cell and i want to add character before that numerical data how can i do it ?
Suppose i have numerical value 50 in particular position in cell i want to make it A50.
Thanks in advance.

Respuesta aceptada

David Sanchez
David Sanchez el 25 de Jul. de 2013
my_char = 'A';
my_number = 50;
my_string = strcat(my_char,num2str(my_number));
  4 comentarios
David Sanchez
David Sanchez el 25 de Jul. de 2013
% char(39) is apostrophe according to ASCII table, then:
str_with_apost = strcat(char(39), 'A50',char(39))
siddhesh rane
siddhesh rane el 25 de Jul. de 2013
its not working..what if i changed it from string to double?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by