Concatinate number and character

4 次查看(过去 30 天)
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.

采纳的回答

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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by