Concatinate number and character

조회 수: 3 (최근 30일)
siddhesh rane
siddhesh rane 2013년 7월 25일
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에서 Environment and Settings에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by